[jboss-user] [EJB 3.0] - Re: Stateless and JNDI once again

2007-05-18 Thread Ulmer
ALRubinger wrote : ...
  | Because more than one classloader was picking up duplicates of the class 
definitions, the WAR-scoped classloader was attempting to cast the object 
retrieved from JNDI (of type recognized by the EJB3 JAR Classloader) and cast 
it (incorrectly) into its own version.
  | 
  | I'm not the most succinct at explaining this, I'm sure, so check the 
references above for a much more detailed and correct description.
  | 
  | Steps I took to get this to work:
  | 
  | * Download and unzip/untar JBoss 4.2.0GA
  | * Delete the WEB-INF/classes directory from the WAR in the EAR
  | * Deploy the EAR
  | 
  | S,
  | ALR

thank you, ALRubinger, it goes!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4046736#4046736

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4046736
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - Re: MBeans: Unable to cast the returned object instance

2007-05-18 Thread Ulmer
genman wrote : Use the javax.management.MBeanServerInvocationHandler class to 
forward calls to your MBean.
  | 
  | You have classcastexception since the same class is loaded in two different 
classloaders.

right. the same was here

http://www.jboss.com/index.html?module=bbop=viewtopicp=4046736#4046736

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4046737#4046737

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4046737
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - ClassCastExeption while invoking a Bean

2007-05-15 Thread Ulmer
hi, 

evaluating a simpliest ejb3 I get the following exception

anonymous wrote : 
  | java.lang.ClassCastException
  | 
com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
  | javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
  | mypackage.MyClientClass.testBeanInvocation(MyClientClass.java:50)
  | sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | java.lang.reflect.Method.invoke(Method.java:597)
  | 
org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:351)
  | 
org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:305)
  | 
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
  | 
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
  | 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
  | 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
  | 
org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
  | 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:346)
  | javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  | javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  | 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 
  | root cause
  | 
  | java.lang.ClassCastException: org.jnp.interfaces.NamingContext cannot be 
cast to org.omg.CORBA.Object
  | 
com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
  | javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
  | mypackage.MyClientClass.testBeanInvocation(MyClientClass.java:50)
  | sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | java.lang.reflect.Method.invoke(Method.java:597)
  | 
org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:351)
  | 
org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:305)
  | 
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
  | 
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
  | 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
  | 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
  | 
org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
  | 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:346)
  | javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  | javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  | 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 
  | 

the executing code:


  | Object ref = ctx.lookup(MyBean);
  | Object narrow = PortableRemoteObject.narrow( ref, MyRemote.class); 
//exception comes here
  | 
  | 

The bean to be invoked is a stateful session bean, deployed in the 
/server/default/deploy as a *.jar.

Does anybody have an idea?

Environment:
Jboss 4.2.0 RC2
Java 6
Windows XP

Regards,

Ulmer

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4045696#4045696

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045696
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: ClassCastExeption while invoking a Bean

2007-05-15 Thread Ulmer
mean while I putted the jar with the ejb and the client war into an ear package.

the jar file was completed with the /META-INF/jboss.xml:

  | ?xml version=1.0 encoding=UTF-8?
  | jboss
  |   enterprise-beans
  | session
  |   ejb-nameMyBean/ejb-name
  |   jndi-nameMyBean/jndi-name
  | /session
  |   /enterprise-beans
  | /jboss
  | 

wolfc, trying your code  I get the following (btw, using the narrow()-method 
makes the same):

anonymous wrote : 2007-05-15 14:31:26,953 ERROR [STDERR] 
javax.naming.NotContextException: 
jboss.j2ee:ear=testapp.ear,jar=mybean.jar,name=MyBean,service=EJB3:a14yg-w8mdj3-f1qcfl91-1-f1qcgfzd-9
 is not a Context
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:692)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
javax.naming.InitialContext.lookup(InitialContext.java:392)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
mypackage.MyTestForm.getTestList(G4SchnittstelleTestForm.java:53)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 2007-05-15 14:31:26,953 ERROR [STDERR]  at 
java.lang.reflect.Method.invoke(Method.java:597)
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4045796#4045796

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045796
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - MBeans: Unable to cast the returned object instance

2007-05-08 Thread Ulmer
Hi all,

executing a mbean method with a custom return type i can't cast the returned 
object instance to the appropriate data type.

ClassCastException:
anonymous wrote : 
  | java.lang.ClassCastException: mypackage.MyDto cannot be cast to 
mypackage.MyDto

MBean:

  | public interface MyMBean extends org.jboss.system.ServiceMBean {
  | ...
  |public MyDto holeMyDto(String test) throws Exception;
  | ...
  | }
  | 

Dto (Data Transfer object)

  | public class MyDto implements Serializable {
  |   private static final long serialVersionUID = 3679919263323839707L;
  | ...
  | }
  | 


Client (deployed in a separate .war)

  |  InitialContext ic = new InitialContext();
  |  String rmiadaptername = jmx/invoker/RMIAdaptor;
  | MBeanServerConnection mbsc = (MBeanServerConnection) 
ic.lookup(rmiadaptername);
  | ObjectName objectName = new ObjectName(objectNameString);
  | Object[] oa = { P};
  | String[] sa = { java.lang.String};
  | Object object = mbsc.invoke(objectName, holeMyDto, oa, sa);
  | DataPoolInfo result = (DataPoolInfo) object; // here comes the Exception
  | 

The execution from the jmx-console works fine. Please help.
Jboss 4.0.5 GA; Jdk 6.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4043949#4043949

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043949
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user