I agree, this is becomming a pain.  I went back to the basics with my
App.  I did exactly what the jbosstest-web.ear does to deploy and lookup
ejbs.  

After I made a couple modifications to my web.xml  Most of my session
beans started working fine.  I started getting NullPointerExceptions
(Below) in Entity Beans now??  I Can't understand why - they shouldn't
be any different than session beans should they?.  Note that everything
works fine if I use tomcat on a remote box instead of deploying an ear
to jboss/tomcat bundle.

I haven't found any Entity Bean tests in the test suite so I couldn't
compare.  This problem may not have anything to do with Session/Entity
and may just be a configuration issue with the beans - I don't know.

I've tried placing the <ejb-ref> tag in the web.xml like the test does,
I've tried placing an <ejb-ref> tag in jboss-web.xml instead like one
user suggested below.  I've tried not placing any <ejb-ref> tags
anywhere and just looking up the JNDI name of the EJB.  Each different
situation seems to have some things that work and some things that
break.  

Maybe someone could suggest the best way to do it that should work every
time.

Question I have:

Assume InitialContext ctx = ....
Assume correct xml config

1.      Is there any big difference between:
        a.      ctx.lookup ("MyEJB" ) 
                without adding anything to the web.xml (like <ejb-ref>)

        b.      ctx.lookup ( "java:comp/env/ejb/MyEJB" );
                after adding <ejb-ref>...name>ejb/MyEJB</name.....
                to the web.xml

2.      Because I am trying to get the app to run on both embedded and 
        remote tomcat configs, I pass in a properties file to   InitialContext
when I create it.  
        ie ctx = new InitialContext(props);
        That way I don't have to modify any tomcat scripts to get the   right
jnp properties and all.

        Does this make any difference to the embedded tomcat on jboss?  

Thanks in advance - 
Dennis



(Exception Mentioned above):  -- NOTE the code that throws this is 
---> if (m.getDeclaringClass().equals(EntityContainer.class)) <---

2002-04-16 17:06:09,324 ERROR [STDERR] java.lang.NullPointerException
2002-04-16 17:06:09,324 ERROR [STDERR]  at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1107)
2002-04-16 17:06:09,324 ERROR [STDERR]  at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73) 
2002-04-16 17:06:09,325 ERROR [STDERR]  at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:230)
2002-04-16 17:06:09,325 ERROR [STDERR]  at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:176)
2002-04-16 17:06:09,325 ERROR [STDERR]  at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
2002-04-16 17:06:09,325 ERROR [STDERR]  at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
2002-04-16 17:06:09,325 ERROR [STDERR]  at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
2002-04-16 17:06:09,326 ERROR [STDERR]  at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
2002-04-16 17:06:09,326 ERROR [STDERR]  at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
2002-04-16 17:06:09,326 ERROR [STDERR]  at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
2002-04-16 17:06:09,326 ERROR [STDERR]  at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)2002-04-16
 17:06:09,326 ERROR [STDERR]  at 
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
2002-04-16 17:06:09,327 ERROR [STDERR]  at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
2002-04-16 17:06:09,327 ERROR [STDERR]  at
org.jboss.ejb.Container.invoke(Container.java:727)
2002-04-16 17:06:09,327 ERROR [STDERR]  at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
2002-04-16 17:06:09,327 ERROR [STDERR]  at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
2002-04-16 17:06:09,327 ERROR [STDERR]  at
org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
2002-04-16 17:06:09,327 ERROR [STDERR]  at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
2002-04-16 17:06:09,328 ERROR [STDERR]  at
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
2002-04-16 17:06:09,328 ERROR [STDERR]  at
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
2002-04-16 17:06:09,328 ERROR [STDERR]  at
org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
2002-04-16 17:06:09,328 ERROR [STDERR]  at
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
2002-04-16 17:06:09,328 ERROR [STDERR]  at
$Proxy383.findByPrimaryKey(Unknown Source)








On Tue, 2002-04-16 at 15:51, James Higginbotham wrote:
> This is absolutely essential for my project, since I've been seeing the
> NPE as well but have to produce a product that can deploy under WL 6.1
> and JB 3.0. I'm in the midst of porting to JB 3.0 with an application
> from WL 6.1 and its been quite painful with the various snafus in the
> beta 1, beta 2, and (presumably) RC1. 
> 
> Is there any way around this coming up, without having to construct
> multiple EAR files for various vendors (yuck!)? Or, is this the intended
> functionality for JB 3.0 now?
> 
> James
> 
> > -----Original Message-----
> > From: David Ward [mailto:[EMAIL PROTECTED]] 
> > Sent: Tuesday, April 16, 2002 6:38 PM
> > To: Dennis Muhlestein
> > Cc: Scott M Stark; [EMAIL PROTECTED]
> > Subject: Re: [JBoss-user] tomcat 4 issue
> > 
> > 
> > I had a similar problem when I went from JBoss-2.4.x_Tomcat-3.2.x to 
> > jboss-3.0.0RC1_tomcat-4.0.3.  I got in the habit of including my ejb 
> > home and remote interfaces in my war file, which works fine 
> > in the older 
> > version.  However, in this latest version, I needed to *not* 
> > include any 
> > ejb interfaces in my war file.  Once I took them out, JBoss was happy 
> > (my null pointer like yours went away).  I attributed it to the new 
> > "UnifiedClassLoader."  I'm not sure if other app servers will 
> > be happy 
> > with this, though.  I always try to make my ear's app-server 
> > agnostic. 
> > I have no problem including multiple extra xml descriptors as 
> > they are 
> > just ignored in other servers (ie: jboss-web.xml vs. weblogic.xml), 
> > however which classes have to get included in the ejb-jars or 
> > wars have 
> > to be the same...
> > 
> > David
> > 
> > --
> > 
> > Dennis Muhlestein wrote:
> > 
> > > That makes sense, thanks.
> > > 
> > > When I deploy my own app, I get the same error that I used to get 
> > > before this whole think came about.
> > > 
> > > CONTAINER EXCEPTION:
> > > java.lang.NullPointerException
> > >         at
> > > 
> > org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.i
> > nvokeHome(StatelessSessionContainer.java:598)
> > >         at
> > > 
> > org.jboss.resource.connectionmanager.CachedConnectionIntercept
> > or.invokeHome(CachedConnectionInterceptor.java:167)
> > >         at
> > > 
> > org.jboss.ejb.plugins.TxInterceptorBMT.invokeHome(TxIntercepto
> > rBMT.java:54)
> > >         at
> > > 
> > org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invo
> > keHome(StatelessSessionInstanceInterceptor.java:57)
> > >         at
> > > 
> > org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityI
> > nterceptor.java:104)
> > >         at
> > > 
> > org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor
> > .java:109)
> > >         at
> > > 
> > org.jboss.ejb.StatelessSessionContainer.invokeHome(StatelessSe
> > ssionContainer.java:300)
> > >         at org.jboss.ejb.Container.invoke(Container.java:727)
> > > 
> > > Still a ClassLoading problem??  A configuration problem?  I wish 
> > > someone could point me in the write path.  MyApp is configured 
> > > according to the contents listed below.  Tomcat works fine, 
> > EJB works 
> > > fine, I just can't talk from a servlet to an EJB else the 
> > error above.
> > > 
> > > Thanks
> > > Dennis
> > 
> > 
> > 
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED] 
> > https://lists.sourceforge.net/lists/listinfo/j> boss-user
> > 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to