[JNDI/Naming/Network] - ClassCastException in remote EJB3.0 lookup from tomcat webap
by skymic
Hi everyone,
I am trying to connect to an EJB3.0 remote session bean (deployed in an ear on JBoss V4.0.5) from a tomcat V5.5 webapp. The tomcat and the JBoss installation are deployed on different machines.
I get the following ClassCastException in a call to PortableRemoteObject.narrow:
java.lang.ClassCastException
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
Caused by: java.lang.ClassCastException: javax.naming.Reference
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
Here is my client code:
String urlName = "jnp://156.135.155.156:1099";
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL, urlName);
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
InitialContext ic = new InitialContext(p);
Object ref = ic.lookup("SDOCIBusinessApp/SDOCIBusinessServiceImpl/remote");
SDOCIBusinessService narrowed = (SDOCIBusinessService )PortableRemoteObject.narrow(ref, SDOCIBusinessService.class);
Here is the list output of jmx-console:
Global JNDI Namespace
+- HASessionState (class: org.jnp.interfaces.NamingContext)
| +- Default (class: org.jboss.ha.hasessionstate.server.HASessionStateImpl)
+- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
+- jmx (class: org.jnp.interfaces.NamingContext)
| +- invoker (class: org.jnp.interfaces.NamingContext)
| | +- RMIAdaptor (proxy: $Proxy52 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
| +- rmi (class: org.jnp.interfaces.NamingContext)
| | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
+- SDOCIBusinessApp (class: org.jnp.interfaces.NamingContext)
| +- SDOCIBusinessServiceImpl (class: org.jnp.interfaces.NamingContext)
| | +- remote (class: java.lang.Object)
| | +- remoteStatefulProxyFactory (proxy: $Proxy87 implements interface org.jboss.ejb3.ProxyFactory)
| +- ExcelConverterImpl (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy79 implements No ClassLoaders found for: ch.skyguide.aim.interfaces.businesslogic.converter.ExcelConverter (no security manager: RMI class loader disabled))
| +- IBriefingExportInvokerImpl (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy82 implements No ClassLoaders found for: ch.skyguide.aim.interfaces.businesslogic.exportinvoker.IBriefingExportInvoker (no security manager: RMI class loader disabled))
I have packaged the EJB plus interfaces in an SDOCIBusinessApp.ear to be deployed on jboss and also as a jar in the WEB-INF/lib directory in the war file of my webapp since the webapp needs to reference the interface SDOCIBusinessService.
I have read all sorts of posted topics which seem to deal with this ClassCastException but I haven't found the solution to my problem yet.
Can anybody help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018849#4018849
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018849
19Â years, 2Â months
[JBoss Seam] - DataModelSelection with two beans without using session scop
by hamtho2
Hi,
is there a possibility to use the @DataModelSelection over two different beans without using the session-scope for injection?
Right now it works if I use the bean with the @DataModel and the @DataModelSelection with session-scope and use this value through an @In annotation in my other bean. But what I don´t like is that I set the value in session-scope then, so that a create=true with the @In-Value might not work because of old values. But everytime I change the scope of the @Out-value to anything other than session, I don´t have any value in my other bean anymore.
Some code for further details:
| @Stateful
| @Name("ActionBeanA")
| @Scope(ScopeType.SESSION)
| public class ActionBeanA implements IActionBeanA{
|
| @DataModel
| private List<Item> itemList;
| @DataModelSelection
| @Out(required=false, scope=ScopeType.SESSION)
| private Item item;
|
|
| @Stateful
| @Name("ActionBeanB ")
| @Scope(ScopeType.CONVERSATION)
| public class ActionBeanB implements IActionBeanB {
|
| @In(required=true, create=true)
| private Item item;
|
|
Thanks for your help
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018845#4018845
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018845
19Â years, 2Â months
[JBoss Seam] - Re: Running the booking example on JBoss with the JSF 1.2 RI
by stan.silvertï¼ jboss.com
"ekusnitz" wrote : I'm also trying to get this running on jboss 4.0.5 and I observe the following:
| 1. In jbossweb-tomcat55.sar, the web.xml in the conf folder does not have any reference to "myfaces-api.jar", but it does refer to "myfaces-impl.jar"
|
There is a mistake in Gavin's original instructions. In conf/web.xml, you need to replace the reference to myfaces-impl.jar with jsf-impl.jar. Here is what it should look like when you are done:
<init-param>
| <description>JSF standard tlds</description>
| <param-name>tagLibJar0</param-name>
| <param-value>jsf-libs/jsf-impl.jar</param-value>
| </init-param>
"ekusnitz" wrote :
| 2. When I try adding el-resolver to the application element, Eclispe IDE tells me it's invalid
|
I also don't use Eclipse, so I'm not sure what's going on here. I suspect that Eclipse is looking at the JSF 1.1 DTD. <el-resolver> is new to JSF 1.2. Perhaps if you post the error I can help.
"ekusnitz" wrote :
| Finally, which el-*.jar files are we supposed to be using? The ones in Seam?
Yes, the ones in Seam should work fine.
Note that all of this configuration is already done for you if you use JBoss 4.2 or JBoss 5.0. JBoss 5.0 has a beta that you can download now. JBoss 4.2 should have a beta available soon. Here are the instructions for using JSF in those releases:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWithJSFCDDL
The goal for these releases is to make the usability of JSF much like that of JSP. In other words, you don't have to think about installation. You just use it if you want it. I'd love to get some feedback.
Stan Silvert
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018844#4018844
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018844
19Â years, 2Â months
[JBoss Seam] - Re: Seam Authenticator and GlassFish
by umrzyk
"shane.bryzak(a)jboss.com" wrote : Does the glassfish version of the booking demo work? It uses a SLSB for authentication.
yes, it works perfectly but it doesn't use JAAS SeamLoginModule what I would like to achieve. The only example that uses JAAS is propably seamspace but i cannot get it working on GF. Instead I wrote a simple code to authenticate user by SeamLoginModule as it was described in seam documentation (chapter 12 - security). Unfortunately i can't pass the login page and still get the 'Login failed' message.
After a while I realized that Authenticator class I have created (12.2.2. Writing an authentication method) is not used at all. Authenticator is annotated as @Name("authenticator") and there is following entry:
<security:identity authenticate-method="#{authenticator.authenticate}"/>
inside components.xml. Is there something more I should do to get it running on GF ?
regards,
michal
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018841#4018841
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018841
19Â years, 2Â months