RE: [jBoss-User] Server exception, HELP please URGENT
Ok, I believe there is a "RMH howto" on the site ;-) go to the webpages and
we will get you going with the "cabin" stuff...
regards
marc
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Aaron Mulder
> Sent: Monday, September 04, 2000 5:10 AM
> To: jBoss
> Subject: Re: [jBoss-User] Server exception, HELP please URGENT
>
>
> URGENT, huh? I wasn't going to help you, until you reposted and
> added an "URGENT" to the end. Sigh. Maybe if you repost and add a "MY
> LIFE IS ON THE LINE" you'll get more help.
> In any case, see below...
>
> On Mon, 4 Sep 2000, [iso-8859-1] joel cordonnier wrote:
> > Hi! I'm a jboss new user, I need HELP
> >
> > I habe a Session bean (named TravelAgentBean) that
> > call a CMP entity bean (named CabinBean).
> > These two beans are deployed separatly, each one with
> > its own file descriptor ejb-jar.xml
> >
> > I have several questions:
> >
> > - In my Session bean, I have:
> > Object obj = jndiContext.lookup("CabinBean"); and it's
> > seems to be OK.
> > When I replace the argument by
> > "java:comp/env/CabinBean" (default Context?) there is
> > an exception, why ?
> > I have to add some property so my jndiContext ?
>
> What's the exception? This may be because you need an ejb-ref
> clause in your jboss.xml that links tells the session bean what to link to
> when you ask for "CabinHome" (see below). Also, you need to make sure the
> home and remote interfaces for the entity bean are available to the
> session bean (put the classes in the session JAR, or add a manifest
> classpath to the JAR, or whatever). By default, a bean sees only the
> classes in its own JAR.
>
> > -At the moment, I don't add a 'jboss.xml' file in my
> > deployed .jar file, so I use the default one.
> > The name of the argument for the 'lookup' is then the
> > name given by the tag in the file
> > ejb-jar.xml, RIGHT ?.?
>
> If you're looking up a bean from the client, then you use the
> (TravelAgentBean below). If you're looking up one bean from
> another using the ejb-ref, then you use java:comp/env/ as
> you tried above.
>
> > And if I add the a 'jboss.xml' file, the name is the
> > one between ?
>
> Correct, so you could list the bean named "TravelAgentBean" in
> JNDI as "GetMeToJamaica" or whatever.
>
> > --- my session bean ejb-jar.xml file:
> >
> >
> > TravelAgentBean
> > com.titan.travelagent.TravelAgentHome
> > com.titan.travelagent.TravelAgent
> > com.titan.travelagent.TravelAgentBean
> > Stateless
> > Container
> >
> > CabinHome
> > Entity
> > com.titan.cabin.CabinHome
> > com.titan.cabin.Cabin
> >
> >
> >
> >
> > --- the end of my jboss.xml file: (1)
> >
> >
> > TravelAgentBean
> > TravelAgentBean
> > Default Stateless
> > SessionBean
> >
> >
> >
> > -- Since my session bean will have to call methods
> > of my entity bean, I hava to add this definitions in
> > jboss.xml ??? (2)
> >
> > CabinBean
> > CabinBean
> > CMP
> > EntityBean
> >
> >
> > THE PROBLEMS ARE:
> > - when i add (1), the deployment failed ! WHY
> > ?
>
> Hmmm... Activating telepathic inducer matrix... Ah. Clearly
> because you forgot to shower this morning. No, seriously, please provide
> a stack trace or any messages in the console areound the deployment
> failure. Also, try turning on verification (in conf/jboss.jcml, find the
> line
>
>false
>
> and change it to "true"). This should print messages about any problems
> it can find, though it doesn't stop the deployer from trying anyway.
>
> > - is the part (2) needed ?
>
> No, to support the ejb-ref, you need an ejb-ref section in the
> section for your session bean. That maps the ejb-ref-name from
> ejb-jar.xml to a JNDI name where the entity bean can be found. You should
> not include a full section on the entity bean unless it is located in the
> same JAR. Here's an example with a session bean that calls another bean
> and uses a data source (which may not be relevant for you):
>
>
>ACDCatalog
>ACDCatalogHome
>Default Stateful
> SessionBean
>
> ejb/ForwardCursor
> ForwardCursorHome
>
>
>
Re: [jBoss-User] Server exception, HELP please URGENT
URGENT, huh? I wasn't going to help you, until you reposted and
added an "URGENT" to the end. Sigh. Maybe if you repost and add a "MY
LIFE IS ON THE LINE" you'll get more help.
In any case, see below...
On Mon, 4 Sep 2000, [iso-8859-1] joel cordonnier wrote:
> Hi! I'm a jboss new user, I need HELP
>
> I habe a Session bean (named TravelAgentBean) that
> call a CMP entity bean (named CabinBean).
> These two beans are deployed separatly, each one with
> its own file descriptor ejb-jar.xml
>
> I have several questions:
>
> - In my Session bean, I have:
> Object obj = jndiContext.lookup("CabinBean"); and it's
> seems to be OK.
> When I replace the argument by
> "java:comp/env/CabinBean" (default Context?) there is
> an exception, why ?
> I have to add some property so my jndiContext ?
What's the exception? This may be because you need an ejb-ref
clause in your jboss.xml that links tells the session bean what to link to
when you ask for "CabinHome" (see below). Also, you need to make sure the
home and remote interfaces for the entity bean are available to the
session bean (put the classes in the session JAR, or add a manifest
classpath to the JAR, or whatever). By default, a bean sees only the
classes in its own JAR.
> -At the moment, I don't add a 'jboss.xml' file in my
> deployed .jar file, so I use the default one.
> The name of the argument for the 'lookup' is then the
> name given by the tag in the file
> ejb-jar.xml, RIGHT ?.?
If you're looking up a bean from the client, then you use the
(TravelAgentBean below). If you're looking up one bean from
another using the ejb-ref, then you use java:comp/env/ as
you tried above.
> And if I add the a 'jboss.xml' file, the name is the
> one between ?
Correct, so you could list the bean named "TravelAgentBean" in
JNDI as "GetMeToJamaica" or whatever.
> --- my session bean ejb-jar.xml file:
>
>
> TravelAgentBean
> com.titan.travelagent.TravelAgentHome
> com.titan.travelagent.TravelAgent
> com.titan.travelagent.TravelAgentBean
> Stateless
> Container
>
> CabinHome
> Entity
> com.titan.cabin.CabinHome
> com.titan.cabin.Cabin
>
>
>
>
> --- the end of my jboss.xml file: (1)
>
>
> TravelAgentBean
> TravelAgentBean
> Default Stateless
> SessionBean
>
>
>
> -- Since my session bean will have to call methods
> of my entity bean, I hava to add this definitions in
> jboss.xml ??? (2)
>
> CabinBean
> CabinBean
> CMP
> EntityBean
>
>
> THE PROBLEMS ARE:
> - when i add (1), the deployment failed ! WHY
> ?
Hmmm... Activating telepathic inducer matrix... Ah. Clearly
because you forgot to shower this morning. No, seriously, please provide
a stack trace or any messages in the console areound the deployment
failure. Also, try turning on verification (in conf/jboss.jcml, find the
line
false
and change it to "true"). This should print messages about any problems
it can find, though it doesn't stop the deployer from trying anyway.
> - is the part (2) needed ?
No, to support the ejb-ref, you need an ejb-ref section in the
section for your session bean. That maps the ejb-ref-name from
ejb-jar.xml to a JNDI name where the entity bean can be found. You should
not include a full section on the entity bean unless it is located in the
same JAR. Here's an example with a session bean that calls another bean
and uses a data source (which may not be relevant for you):
ACDCatalog
ACDCatalogHome
Default Stateful SessionBean
ejb/ForwardCursor
ForwardCursorHome
jdbc/ACDCatalogDB
CPIDB
> AND AND.
> When i use only the ejb-jar.xml file (no jboss.xml
> file, and the deployment process is OK) i have a
> SERVER EXCEPTION when i have
> 'Class aClass = CabinHome.class , 'aClass' used for
> the call PortableRemoteObject)
>
> java.rmi.ServerException:RemoteException occured in
> server thread; nested exception is:
> java.rmi.ServerException occured:
> com.titan.cabin.CabinHome
> at sun.rmi.transport.StreamRemoteCall exception
> received (FromServerStreamRemoteCall.java:245)
> .
> at
>
>org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:164)
> at §Proxy1.listCabins(Unknown source)
> at com.titan.travelagent.TravelAgentClient_1
Well, the ServerException may have another exception at it's
heart, which is what you'd be interested in. Also, I assume you're using
the same JDK version on both client and server? Finally, this could be
caused by what I mentioned far above - if you package beans in different
JARs, they need to have access to each other's home and remote
interfaces. And the client needs the same interfaces, for that matter.
>
> Thanks for any help
>
> Joel Cordonnier
You may consider attempting to package all the beans in one JAR -
it definitely makes it
Re: [jBoss-User] Server exception, HELP please URGENT
joel cordonnier wrote: > > --- my session bean ejb-jar.xml file: > > > TravelAgentBean > com.titan.travelagent.TravelAgentHome > com.titan.travelagent.TravelAgent > com.titan.travelagent.TravelAgentBean > Stateless > Container > > CabinHome Try changing CabinHome with ejb/CabinHome > Entity > com.titan.cabin.CabinHome > com.titan.cabin.Cabin Try adding CabinHome here > > > I have a similar config in a package I'm developing and it works. Hope it helps :-) Carlos Valiente <[EMAIL PROTECTED]> -- "Que la Rumba te acompañe" - Ahí va Juan Ke No Ve, Villaverde Alto -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
