Theorically, I'm using an embedded Tomcat and I'm aware of the local/remote interface problems. But it seems I don't use it properly :( I have no working example. Now my code is as follow:
public void setSessionContext( SessionContext sessionContext ) { try { Context namingContext = new javax.naming.InitialContext(); sequenceSessionLocal = ( (SequenceSessionLocalHome) namingContext.lookup( "myrpg-atlas/SequenceSession" ) ).create(); userLocalHome = (UserLocalHome) namingContext.lookup( "myrpg-atlas/User" ); } catch( CreateException ce ) { throw new EJBException( ce ); } catch( NamingException ne ) { throw new EJBException( ne ); } } But I encounter the exception: java.rmi.ServerException: $Proxy42; nested exception is: java.lang.ClassCastException: $Proxy42 at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:119) ... Caused by: java.lang.ClassCastException: $Proxy42 at org.myrpg.atlas.ejb.UserSessionBean.setSessionContext(UserSessionBean.java:72) at org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:47) at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:61) at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:208) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:63) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96) any clue? tia, wondersonic --- Wim Praet <[EMAIL PROTECTED]> a écrit : > If you are using embedded tomcat, you should not set > context like > > > Properties props = > (Properties)System.getProperties().clone(); > props.setProperty( > "java.naming.factory.initial", > "org.jnp.interfaces.NamingContextFactory" ); > props.setProperty( > "java.naming.provider.url","jnp://localhost:1099" ); > props.setProperty( > "java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces" > ); > > Context namingContext = new > javax.naming.InitialContext( props ); > > but just create a new context with no params, since > tomcat then uses the > same jndi context as jboss. Also: you can only use > local interfaces in > embedded tomcat, external tomcat will serialize > everything and hence ressort > to remote interfaces (so if you are indeed using an > external tomcat, you > can't even lookup those local homes). > > And in jboss 3.x indeed the client interfaces may be > ommitted from the > webapp lib dir, due to the change in classloading > (als Alex reminded me). > > kind regards, > Wim. > > > ----- Original Message ----- > From: "wonder sonic" <[EMAIL PROTECTED]> > To: "Wim Praet" <[EMAIL PROTECTED]> > Sent: Tuesday, May 28, 2002 3:52 PM > Subject: Re: Re[8]: [JBoss-user] [HELP] Is there > someone to help me? > > > > Well, you've missed no mail but the last one (with > a > > 50ko .doc file), I'm sending it to you, it resumes > > my tests ;) > > > > > > --- Wim Praet <[EMAIL PROTECTED]> a écrit : > > Hello > > both of you, > > > I was reading this discussion on JBoss-user but > I > > > have the idea not every > > > mail is on it, since there is missing content > after > > > " ws> ... > > > setSessionContext of my ... " ? > > > > > > What is the new error you get when removing the > > > client interfaces from the > > > webapp lib dir? And do you or do you _not_ need > to > > > add those client > > > interfaces to the webapp? (I thought the webapp > > > needed them always in the > > > lib but as I can read from this discussion it is > not > > > necessary?!) > > > > > > > > > > ws> Well, I'm sorry of this but I have to tell > you > > > that > > > > ws> once I removed the myrpg-atlasclient.jar > file > > > where > > > > ws> stands the UserSession and UserSessionHome > > > files, an > > > > ws> other error occured IN the > setSessionContext > > > of my > > > > UserSession bean =>> the JNDI lookup worked! > > > > > > > > ws> Is it a bug or what??? > > > > ws> I'm using the JBoss 3.0 RC1 + Tomcat 4.0.3 > > > version, > > > > > > > > What the error is? > > > > > > > > ws> wondersonic > > > > > > > > ___________________________________________________________ > > Do You Yahoo!? -- Une adresse @yahoo.fr gratuite > et en français ! > > Yahoo! Mail : http://fr.mail.yahoo.com > ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user