Re: [JBoss-user] embedded tomcat 4 issue

2002-04-17 Thread Scott M Stark

 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.
There are now and accessing them from a servlet works fine.

 1. Is there any big difference between:
  a. ctx.lookup (MyEJB )=20
   without adding anything to the web.xml (like ejb-ref)
 
  b. ctx.lookup ( java:comp/env/ejb/MyEJB );
   after adding ejb-ref...nameejb/MyEJB/name.
   to the web.xml
a. requires that you embed the deployed name of the ejb home in
your code while b. is independent of this.

 2. Because I am trying to get the app to run on both embedded and=20
  remote tomcat configs, I pass in a properties file to  InitialContext
 when I create it. =20
  ie ctx =3D 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? =20

It should not make a difference.

Look at the jbosstest-web.ear again and submit a bug report with an example
ear that demonstrates the problem.


Scott Stark
Chief Technology Officer
JBoss Group, LLC





___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] embedded tomcat 4 issue

2002-04-17 Thread Dennis Muhlestein

Thank you for your input.  I'm making much progress in this area and
most of my application works with tomcat locally now.

I have got everything to work at this point except for one Entity Bean
(CMP 2.0).  I have other Entity Beans that work fine.  So this is really
tricky.

I can lookup the bean and get the Home Interface from my servlet/jsp. 
Then, when I try to call findByPrimaryKey, I get a NullPointerException:

java.rmi.ServerException: null; nested exception is:
java.lang.NullPointerException
2002-04-17 11:03:33,118 ERROR [STDERR] java.lang.NullPointerException
2002-04-17 11:03:33,118 ERROR [STDERR]  at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer
.java:1107)
2002-04-17 11:03:33,119 ERROR [STDERR]  at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java
:73)
2002-04-17 11:03:33,119 ERROR [STDERR]  at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynch
ronizationInterceptor.java:230)
2002-04-17 11:03:33,119 ERROR [STDERR]  at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome
etc...


This is funny because it only happens on this one bean.  Other beans are
configured the same way and work fine.  Also this works when I use
tomcat on a remote box (I just checked again to make sure) or in a
separate JVM.

I added some debug statements to org.jboss.ejb.EntityContainer.java  I
found that The map does contain an entry for the findByPrimaryKey method
but when the homeMapping.get(mi.getMethod()) is called, it returns null.

Is this a class Loading issue like there used to be?  I wish I could
submit a test cast but when I try a simple example it works fine.  I
have 10-15 beans deployed/a mix of Session/SLS/Entity.  The problem
occurs on this one bean every time without fail and independent of which
jsp/servlet tries to use it.  Everything works great when I run tomcat
on a separate box.

In the mean time, I'll keep playing and seeing if I can find something
unique about this bean?

Again, Thanks for any input.
-Dennis


On Wed, 2002-04-17 at 02:51, Scott M Stark wrote:
  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.
 There are now and accessing them from a servlet works fine.
 
  1. Is there any big difference between:
   a. ctx.lookup (MyEJB )=20
without adding anything to the web.xml (like ejb-ref)
  
   b. ctx.lookup ( java:comp/env/ejb/MyEJB );
after adding ejb-ref...nameejb/MyEJB/name.
to the web.xml
 a. requires that you embed the deployed name of the ejb home in
 your code while b. is independent of this.
 
  2. Because I am trying to get the app to run on both embedded and=20
   remote tomcat configs, I pass in a properties file to  InitialContext
  when I create it. =20
   ie ctx =3D 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? =20
 
 It should not make a difference.
 
 Look at the jbosstest-web.ear again and submit a bug report with an example
 ear that demonstrates the problem.
 
 
 Scott Stark
 Chief Technology Officer
 JBoss Group, LLC
 
 
 
 




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


RE: [JBoss-user] embedded tomcat 4 issue

2002-04-16 Thread Dennis Muhlestein

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...nameejb/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 

Re: [JBoss-user] embedded tomcat 4 issue

2002-04-16 Thread Dmitri Colebatch

Hi,

 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.

You're better off using the new InitialContext() constructor with no params, and 
setting system properties through the
jndi.properties file int he classpath.

as far as the rest of things go, this is with jetty, but it might help:

http://main.jboss.org/thread.jsp?forum=50thread=4046message=384447

cheers
dim


- Original Message -
From: Dennis Muhlestein [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 17, 2002 8:48 AM
Subject: RE: [JBoss-user] embedded tomcat 4 issue




___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user