[jboss-user] [Installation, Configuration Deployment] - classcast exception
When i deploy a session bean in JBoss, while deploying i got classcast exception . When i am looking thro ctxlook up, it is always returing the object ref as JNDI name+Home. why this error is coming? i need help. servlet code code: | | try { | | InitialContext ctx = new InitialContext(); | System.out.println(aa); | | Object objref = ctx.lookup(ejb/test/MyTestSessionBean/remote); | //testSessionBean = (MyTestSessionHome)ctx.lookup(test.session.MyTestSessionBean.class.getName()); | //testSessionBean = (MyTestSessionHome)ctx.lookup(test/session/MyTestSessionBean); | System.out.println(b+objref); | | testSessionBean = (MyTestSessionHome)PortableRemoteObject.narrow(objref, MyTestSessionHome.class); | System.out.println(c); | |} catch (Exception NamingException) { | | NamingException.printStackTrace(); THis is the output in Jboss: 393 INFO [STDOUT] bejb/test/MyTestSessionBean/remoteHome 11:43:38,408 ERROR [STDERR] java.lang.ClassCastException 11:43:38,413 ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293) If the code is like this in the lookup: Object objref = ctx.lookup(ejb/test/MyTestSessionBean); It returns objref like this:MyTestSessionBeanHome - This class does not exist. I need help. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4038724#4038724 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4038724 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Re: Jboss install
/* * SessionTestServlet.java * */ package test.session; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import javax.naming.*; import javax.rmi.PortableRemoteObject; /** * @author Deepak Kumar * @Web http://www.roseindia.net * @Email [EMAIL PROTECTED] */ public class SessionTestServlet extends HttpServlet { MyTestSessionHome testSessionBean; public void init(ServletConfig config) throws ServletException{ //Look up home interface try { InitialContext ctx = new InitialContext(); Object objref = ctx.lookup(ejb/test/MyTestSessionBean); testSessionBean = (MyTestSessionHome)PortableRemoteObject.narrow(objref, MyTestSessionHome.class); } catch (Exception NamingException) { NamingException.printStackTrace(); } } public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out; response.setContentType(text/html); String title = EJB Example; out = response.getWriter(); out.println(); out.println(); out.println(Hello World Servlet!); out.println(); out.println(); out.println(p align=\center\font size=\4\ color=\#80\Servlet Calling Session Bean); try{ MyTestSession beanRemote; beanRemote = testSessionBean.create(); out.println(p align=\center\ Message from Session Bean is: + beanRemote.SayHello() + ); beanRemote.remove(); }catch(Exception CreateException){ CreateException.printStackTrace(); } out.println(p align=\center\a href=\javascript:history.back()\Go to Home); out.println(); out.println(); out.close(); } public void destroy() { System.out.println(Destroy); } } deployment des: ejb-jar Example 3 display-nameExample 3/display-name enterprise-beans !-- Session Beans -- display-nameMy Test Session Bean/display-name ejb-nametest/MyTestSession/ejb-name test.session.MyTestSessionHome test.session.MyTestSession ejb-classtest.session.MyTestSessionBean/ejb-class session-typeStateless/session-type transaction-typeContainer/transaction-type /enterprise-beans assembly-descriptor /assembly-descriptor /ejb-jar jboss.xml: enterprise-beans ejb-nametest/MyTestSession/ejb-name jndi-nameejb/test/MyTestSessionBean/jndi-name /enterprise-beans resource-managers /resource-managers View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4037419#4037419 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4037419 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Re: Jboss install
I have found the problem. i don't know how to resolve it. The JDK which i have installed is jdk1.0.5_11 In this rt.jar has 2 Portable object classes at 1.at com.sun.corba.se.impl.javax.rmi.PortableRemot eobject.narrow(PortableRemoteObject.java:229) 2.at javax.rmi.PortableRemoteObject.narrow(Portabl eRemoteObject.java:137) That is y when i copy the bean it was giving this exception. i need soln for this View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4037422#4037422 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4037422 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Re: Jboss install
i tried as method given by u. But it was giving exception in default loader repositry class View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036659#4036659 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036659 ___ jboss-user mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Re: Jboss install
Thanks, today it build successfully . The path iin etc/profile i made change, i set it yesterday like this #java JAVA_HOME= /usr/java/jdk1.5.0_11 PATH=/usr/java/jdk1.5.0_11/bin:$PATH CLASSPATH=/usr/java/jdk1.5.0_11/lib:$CLASSPATH #ANT1.6 ANT_HOME=/home/servers/java/apache-ant-1.6.0 PATH=/home/servers/java/apache-ant-1.6.0/bin:$PATH earlier th e order was different. it build successful today. I downloaded example3.ear from roseindia.net, this i copied to jboss deploy , iimmediately it gave error like this classcast exception . This is happening for both the downloaded bin jboss and in the built jboss also . my profile setting now is: #java JAVA_HOME= /usr/java/jdk1.5.0_11 PATH=/usr/java/jdk1.5.0_11/bin:$PATH CLASSPATH=/usr/java/jdk1.5.0_11/lib:$CLASSPATH #JBoss #JBOSS_HOME=/home/servers/java/jboss-4.0.5.GA JBOSS_HOME=/home/servers/java/jboss-4.0.5.GA-src/build/output/jboss-4.0.5.GA #ANT1.6 ANT_HOME=/home/servers/java/apache-ant-1.6.0 PATH=/home/servers/java/apache-ant-1.6.0/bin:$PATH #ANT #ANT_HOME=/home/servers/java/apache-ant-1.7.0 #PATH=/home/servers/java/apache-ant-1.7.0/bin:$PATH #J2EE #CLASSPATH=/home/servers/java/j2ee.jar:$CLASSPATH export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC PGPORT LD_LIBRARY_PATH PATH MANPATH CLASSPATH JAVA_HOME JBOSS_HOME ANT_HOME i need help to resolve this error: is: 09:08:23,438 INFO [ProxyFactory] Bound EJB Home 'test/MyTestSession' to jndi 'ejb/test/MyTestSessionBean' 09:08:23,482 INFO [EJBDeployer] Deployed: file:/home/servers/java/jboss-4.0.5.GA-src/build/output/jboss-4.0.5.GA/server/default/tmp/deploy/tmp2627example3.ear-contents/example3.jar 09:08:23,900 INFO [TomcatDeployer] deploy, ctxPath=/example3, warUrl=.../tmp/deploy/tmp2627example3.ear-contents/example3-exp.war/ 09:08:24,708 ERROR [STDERR] java.lang.ClassCastException 09:08:24,746 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229) 09:08:24,747 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) 09:08:24,748 ERROR [STDERR] at test.session.SessionTestServlet.init(SessionTestServlet.java:29) 09:08:24,789 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105) 09:08:24,790 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) 09:08:24,827 ERROR [STDERR] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) 09:08:24,828 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) 09:08:24,865 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036934#4036934 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036934 ___ jboss-user mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - session bean
i have deployed a session bean example3.ear which i downloaded. it was working and to build the src i installed ant tool and j2ee.jar, i copied t he build ear and downloaded ear alternatively. Jboss gives same exception as mentioned below. how to resolve this. 14:04:55,756 ERROR [STDERR] java.lang.ClassCastException 14:04:55,799 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemot eObject.narrow(PortableRemoteObject.java:229) 14:04:55,800 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(Portabl eRemoteObject.java:137) 14:04:55,838 ERROR [STDERR] at test.session.SessionTestServlet.init(SessionT estServlet.java:29) 14:04:55,839 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load Servlet(StandardWrapper.java:1105) 14:04:55,840 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load (StandardWrapper.java:932) 14:04:55,878 ERROR [STDERR] at org.apache.catalina.core.StandardContext.load OnStartup(StandardContext.java:3951) 14:04:55,920 ERROR [STDERR] at org.apache.catalina.core.StandardContext.star View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036272#4036272 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036272 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Jboss install
I have downloaded ant1.6, and tried to build Jbossas from the source jboss-4.0.5.GA-src.tar.gz, i am using RHEL4, Jdk path in etc/profile #java JAVA_HOME= /usr/java/jdk1.5.0_11 PATH=/usr/java/jdk1.5.0_11/bin:$PATH CLASSPATH=/usr/java/jdk1.5.0_11/lib:$CLASSPATH #ANT1.6 ANT_HOME=/home/servers/java/apache-ant-1.6.0 PATH=/home/servers/java/apache-ant-1.6.0/bin:$PATH i run this command ant -buildfile build.xml when i am building i got this problem init: compile-idl: [jacidl] scan file: /home/servers/java/jboss-4.0.5.GA-src/iiop/src/idl/SASCurrent.idl [jacidl] scan file: /home/servers/java/jboss-4.0.5.GA-src/iiop/src/idl/TransactionService.idl [jacidl] processing idl file: /home/servers/java/jboss-4.0.5.GA-src/iiop/src/idl/SASCurrent.idl [jacidl] processing idl file: /home/servers/java/jboss-4.0.5.GA-src/iiop/src/idl/TransactionService.idl compile-classes: compile-rmi: [rmic] RMI Compiling 1 class to /home/servers/java/jboss-4.0.5.GA-src/iiop/output/classes [rmic] IIOP has been turned on. java.lang.UnsatisfiedLinkError: hasStaticInitializer at com.sun.corba.ee.internal.io.ObjectStreamClass.hasStaticInitializer(Native Method) at com.sun.corba.ee.internal.io.ObjectStreamClass._computeSerialVersionUID(ObjectStreamClass.java:943) at com.sun.corba.ee.internal.io.ObjectStreamClass.(ObjectStreamClass.java:459) at com.sun.corba.ee.internal.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:139) at com.sun.corba.ee.internal.io.ObjectStreamClass.lookup(ObjectStreamClass.java:96) at com.sun.corba.ee.internal.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:133) at com.sun.corba.ee.internal.io.ObjectStreamClass.lookup(ObjectStreamClass.java:96) at com.sun.corba.ee.internal.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:159) at com.sun.corba.ee.internal.util.RepositoryId.(RepositoryId.java:150) at sun.rmi.rmic.iiop.IDLNames.convertToISOLatin1(IDLNames.java:139) at sun.rmi.rmic.iiop.IDLNames.getClassOrInterfaceName(IDLNames.java:233)at sun.rmi.rmic.iiop.CompoundType.(CompoundType.java:644) at sun.rmi.rmic.iiop.InterfaceType.(InterfaceType.java:104) at sun.rmi.rmic.iiop.RemoteType.(RemoteType.java:115) at sun.rmi.rmic.iiop.RemoteType.forRemote(RemoteType.java:79) at sun.rmi.rmic.iiop.StubGenerator.getTopType(StubGenerator.java:119) at sun.rmi.rmic.iiop.Generator.generate(Generator.java:262) at sun.rmi.rmic.Main.doCompile(Main.java:526) at sun.rmi.rmic.Main.compile(Main.java:133) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.taskdefs.rmic.SunRmic.execute(SunRmic.java:91) at org.apache.tools.ant.taskdefs.Rmic.execute(Rmic.java:520) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306) at org.apache.tools.ant.Task.perform(Task.java:401) at org.apache.tools.ant.Target.execute(Target.java:338) at org.apache.tools.ant.Target.performTasks(Target.java:365) at org.apache.tools.ant.Project.executeTarget(Project.java:1237) at org.jboss.tools.buildmagic.task.CallTarget.execute(CallTarget.java:141) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306) at org.apache.tools.ant.Task.perform(Task.java:401) at org.apache.tools.ant.Target.execute(Target.java:338) at org.apache.tools.ant.Target.performTasks(Target.java:365) at org.apache.tools.ant.Project.executeTarget(Project.java:1237) at org.jboss.tools.buildmagic.task.Ant.execute(Ant.java:261) at org.jboss.tools.buildmagic.task.module.ExecuteModules$1.run(ExecuteModules.java:361) at org.jboss.tools.buildmagic.task.module.ExecuteModules.executeModule(ExecuteModules.java:376) at org.jboss.tools.buildmagic.task.module.ExecuteModules.execute(ExecuteModules.java:241) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306) at org.apache.tools.ant.Task.perform(Task.java:401) at org.apache.tools.ant.Target.execute(Target.java:338) at org.apache.tools.ant.Target.performTasks(Target.java:365) at org.apache.tools.ant.Project.executeTarget(Project.java:1237) at org.apache.tools.ant.Project.executeTargets(Project.java:1094) at org.apache.tools.ant.Main.runBuild(Main.java:669) at org.apache.tools.ant.Main.startAnt(Main.java:220) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90) [rmic] error: An error has occurred in the compiler; please