[Tomcat, HTTPD, Servlets & JSP] - Re: Explicit document source root using context/docbase
by gburcher
I found a suggestion in another thread, dated 3/21/2006:
anonymous wrote : AFAIK, deploying a war by simply deploying a context.xml is not supported.
|
| You can configure JBoss to scan external directories for deployment; look at the server/.../conf/jboss-service.xml file, DeploymentScanner MBean, URLs attribute.
|
| _________________
| Brian Stansberry
| Lead, AS Clustering
| JBoss, a division of Red Hat
|
I added my external directory to the URLs attribute under the DeploymentScanner MBean in server.xml. At startup, JBoss finds my deployment directory, reads the \WEB-INF\web.xml file located in the deployment directory, but I get this error:
09:04:35,626 ERROR [MainDeployer] Could not create deployment: file://C:/dev/test.war org.jboss.ws.WSException: java.lang.ClassNotFoundException: com.my.package.MyServlet
I have my .class files in an expanded package/directory structure located under \WEB-INF\classes. JBoss cannot find the class associated with my servlet definition in web.xml. I tried adding this to my web.xml:
<class-loader>
| <simple-loader path="c:/dev/test.war/WEB-INF/xsl"/>
| <compiling-loader path="c:/dev/test.war/WEB-INF/classes"/>
| <library-loader path="c:/dev/test.war/WEB-INF/lib"/>
| </class-loader>
|
Not sure if these elements are supported by JBoss in web.xml under the web-app element. I had used these elements as part of my Caucho Resin web.xml file. This class-loader info did not seem to help, still got ClassNotFoundException.
Has anyone tried using this technique with the DeploymentScanner? Any help on how to help JBoss find the .class files?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964977#3964977
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964977
19 years, 10 months
[JBoss Seam] - Re: EntityManager: For newbies or to close gaps in your know
by bfo81
1) TX.NOT_SUPPORTED is quite interesting, too. I mean sometimes you have a backing SFSB that provides additional functionality e.g. validation that can't be done directly in JSF (e.g. comparing two entered passwords like in user registration). You sure don't want flush() to be called after that ;). So that's an important tip, thanks.
2) But I still have problems understanding those LazyInitalisationExceptions. I mean, look at that example code:
Let's assume we want to edit a person (first/last name, birthday...) and we have a select menu to choose some friends (that are also persons here)
@Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("personEditor")
| public class PersonEditorBean implments PersonEditor {
|
| @In(required=false) @Out(required=false)
| private Person person;
|
| @PersistenceContext(type=PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| @RequestParameter
| private Long personId;
|
| @Begin
| public String startEditing() {
| person = em.find(Person.class, personId);
| return "editorPage";
| }
|
| ....
| }
Now the editor page looks like that:
...
| <h:selectManyMenu value="#{person.friends}" ...
|
Guess what? In this case there is NO LazyInitalisationException, though the person's getFriends() method is being called by JSF, what leads to a lazy fetching (I can see it in the logs, there's really no eager fetching).
QUESTION: When accessing collections of seam components, why is there no LIE? Do those components remain managed?
PS: When using normal (i.e. transaction scoped) persistence context instead of the extended one there are exceptions of course.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964975#3964975
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964975
19 years, 10 months
[JBoss Seam] - Calling Seam Components (Stateless EJB) outside Seam app. Po
by msteiner
I have 2 Seam appllications (ears). When I call from one app, EJB method from another app I get NPE in Component class (getApplicationContext() returns null):
| public static Component forName(String name)
| {
| return (Component) Contexts.getApplicationContext().get( name + ".component" );
| }
|
This method is called by SeamInterceptor (PostConstruct method -> getSeamComponent).
When I first call this EJB in normal Seam way ( with @In and from its own application ) and then call it from other ear with @EJB this sometimes works. In other words: if method PostConstruct from SeamInterceptor is called outside seam application (with @EJB) then NPE is throwed.
It is legal to call EJB's annotated with @name outside Seam app ?
How to deal with such scenario:
I have 2 Seam applications (separeted ears) event in one application should begin jbpm process in second application and pass paramers to its business context. Is this possible ? How ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964973#3964973
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964973
19 years, 10 months