ClassCastException on narrow

We have a project that we deploy to Jboss 3.2.1/Tomcat 4.1.24. We will call it proj1.ear. We have another project (proj2.ear) that has a stateless session bean (SessBeanProj2). SessBeanProj2 would really like to reuse a stateless session bean in proj1 (UsefulSessBeanProj1 � actually sits in proj1EJB.jar which is eared up in proj1.ear). Here�s a code snippet:
InitialContext ctx = new InitialContext();
Object fromJNDI = ctx.lookup("ejb/UsefulSBProj1");
Object usefulSbHome = PortableRemoteObject.narrow(fromJNDI, IUsefulSBProj1Home.class);
This throws a ClassCastException. The stacktrace is below.
I have been researching this for a bit, so I have heard some things about Classloaders and some about the Classpath, but I need some more specifics. If it is the classpath issue, what do I need on the classpath? Do I need the ear on the classpath? Or just proj1EJB.jar? I am putting these things on the Class-Path line in my manifest file � is this the correct way?
As you can see, I�m grasping. Any help would be much appreciated. Thanks!
Here is part of the stacktrace. I will give you the whole thing if you think it will be useful, but I didn�t think it would be:
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at com.ndwc.proj2.ejb.bo.SessBeanProj2.daMethod(SessBeanProj2.java:92)
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:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)

We have a project that we deploy to Jboss 3.2.1/Tomcat
4.1.24. We will call it proj1.ear. We have another
project (proj2.ear) that has a stateless session bean
(SessBeanProj2). SessBeanProj2 would really like to
reuse a stateless session bean in proj1
(UsefulSessBeanProj1 ? actually sits in proj1EJB.jar
which is eared up in proj1.ear). Here?s a code
snippet:
InitialContext ctx = new InitialContext();
Object fromJNDI = ctx.lookup("ejb/UsefulSBProj1");
Object usefulSbHome =
PortableRemoteObject.narrow(fromJNDI,
IUsefulSBProj1Home.class);
Should be IUsefulSBProj1Home usefulSbHome = (IUsefulSBProj1Home)PortableRemoteObject.narrow(fromJNDI, IUsefulSBProj1Home.class); as the Object you are trying to bind the fromJNDI object to is of the IUsefulSBProj1Home type.
This throws a ClassCastException. The stacktrace is
below.
I have been researching this for a bit, so I have
heard some things about Classloaders and some about
the Classpath, but I need some more specifics. If it
is the classpath issue, what do I need on the
classpath? Do I need the ear on the classpath? Or just
proj1EJB.jar? I am putting these things on the
Class-Path line in my manifest file ? is this the
correct way?
As you can see, I?m grasping. Any help would be much
appreciated. Thanks!
Here is part of the stacktrace. I will give you the
whole thing if you think it will be useful, but I
didn?t think it would be:
java.lang.ClassCastException
at
at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObje
t.narrow(PortableRemoteObject.java:293)
at
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteOb
ect.java:134)
at
at
com.ndwc.proj2.ejb.bo.SessBeanProj2.daMethod(SessBeanP
oj2.java:92)
at
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
dAccessorImpl.java:39)
at
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
ingMethodAccessorImpl.java:25)
at
at java.lang.reflect.Method.invoke(Method.java:324)
at
at
org.jboss.ejb.StatelessSessionContainer$ContainerInter
eptor.invoke(StatelessSessionContainer.java:629)
at
at
org.jboss.resource.connectionmanager.CachedConnectionI
terceptor.invoke(CachedConnectionInterceptor.java:186)

Similar Messages

  • Java.lang.ClassCastException: Cannot narrow remote object weblogic.rmi.inte

    Hi,
    I am trying to deploy ejb3.0 on weblogic 10 server. I am able to find the JNDI name of the stateless session bean correctly, but getting an exception while narrowing it down. My ejb3.0 client is a standalone java client. I am trying to access the stateless session ejb3.0 bean.Please help me. i have been trying it for many days.
    thanks in advance,
    Sanjeev
    [sanpraka@localhost certEjb]$ java -cp ./:/usr/weblogic/bea/wlserver_10.0/server/lib/weblogic.jar:/usr/weblogic/bea/wlserver_10.0/server/lib/wlclient.jar com.titan.clients.Client
    Object is weblogic.rmi.internal.BasicRemoteRef - hostID: '5337880647112897730S:127.0.0.1:[7001,7001,-1,-1,-1,-1,-1]:wl_server:examplesServer', oid: '302', channel: 'null'
    java.lang.ClassCastException: Cannot narrow remote object weblogic.rmi.internal.BasicRemoteRef - hostID: '5337880647112897730S:127.0.0.1:[7001,7001,-1,-1,-1,-1,-1]:wl_server:examplesServer', oid: '302', channel: 'null' to com.titan.travelagent.TravelAgentRemote
    at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
    at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
    at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
    at com.titan.clients.Client.main(Client.java:24)
    [sanpraka@localhost certEjb]$

    We have a similar problem. We have a web application (on server A) that invokes an EJB on a remote server (server B). This works fine, until we deploy another web application to server A at which point the existing web application starts to throw java.lang.ClassCastException when narrowing the remote EJB interface. The exception starts to be thrown at the moment the latter web application is deployed - start is not required.
    The latter web application contains (actually in APP-INF/lib) the old version of the EJB remote interface, that somehow gets to be loaded into the classpath of the existing web application. The solution is to delete the old version of the EJB remote interface from APP-INF/lib of the latter web application (we didn't need it anyway), but it would be interesting to know in which circumstances classes can get mixed between enterprise applications.
    I failed to reproduce the error in simple scenario, so this does not happen always.

  • ClassCastException while narrow an EJV using RMI-IIOP

    Hi,
    I'm trying to deploy an EJB on weblogic 6.1 SP4 on an AIX system, and a client
    (JSP) running on weblogic 6.1 SP4 on a SUN system. And, the dialog between EJB
    and servlet has to use RMI-IIOP (due to exploitation constraints).
    I receive this exception when getting the reference of the EJB's home :
    java.lang.ClassCastException: Cannot narrow remote object to ejbMweb.TstEjbMwebHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:124)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:132)
    at cliEjbMweb.cliTstMweb.narrow(cliTstMweb.java:133)
    at cliEjbMweb.cliTstMweb.getHome(cliTstMweb.java:31)
    at cliEjbMweb.cliTstMweb.testBean1(cliTstMweb.java:53)
    at jsp_servlet.__index._jspService(__index.java:91)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:321)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    The same test using t3 is running OK (there is no problem of classpath).
    Can you hel me ?
    Thank you !
    Marc

    "Marc" <[email protected]> writes:
    It can't download the stub, you need to set an appropriate security
    manager for the RMIClassLoader to work, or make sure the stubs are on
    the client.
    andy
    Hi,
    I'm trying to deploy an EJB on weblogic 6.1 SP4 on an AIX system, and a client
    (JSP) running on weblogic 6.1 SP4 on a SUN system. And, the dialog between EJB
    and servlet has to use RMI-IIOP (due to exploitation constraints).
    I receive this exception when getting the reference of the EJB's home :
    java.lang.ClassCastException: Cannot narrow remote object to ejbMweb.TstEjbMwebHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:124)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:132)
    at cliEjbMweb.cliTstMweb.narrow(cliTstMweb.java:133)
    at cliEjbMweb.cliTstMweb.getHome(cliTstMweb.java:31)
    at cliEjbMweb.cliTstMweb.testBean1(cliTstMweb.java:53)
    at jsp_servlet.__index._jspService(__index.java:91)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:321)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    The same test using t3 is running OK (there is no problem of classpath).
    Can you hel me ?
    Thank you !
    Marc

  • ClassCastException While Narrowing

    Hi,
    I have my application deployed as EAR file, with a WAR and two JAR for the statelesss session beans. On Server start up I call a servlet (in the WAR), which invokes the EJB deployed in one of the JAR file. At that instance it is giving the following Error:
    Exception :Cannot narrow remote object to au.com.three.hutchison.hss.ejb.staticinfo.StaticInfoHome
    java.lang.ClassCastException: Cannot narrow remote object to au.com.three.hutchison.hss.ejb.staticinfo.StaticInfoHome
         at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at au.com.three.hutchison.hss.service.HSSServiceFactory.narrow(Unknown Source)
         at au.com.three.hutchison.hss.service.HSSServiceFactory.lookupHome(Unknown Source)
         at au.com.three.hutchison.hss.service.HSSServiceFactory.getRemote(Unknown Source)
         at au.com.three.hutchison.init.InitConfigInfoServlet.init(Unknown Source)
         at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1070)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:893)
         at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:842)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:782)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3236)
    The same code used to work fine before, but I had some class loader issues to resolve which i set the 'prefer-web-inf-classes' to true in the weblogic.xml of the WAR. However after that I started getting the ClassCastException problem..
    Any Help Would be Hghly Appreciated
    Thanks
    Nitin

    here's the weblogic-application.xml that i have used to specify different classloaders
    <!DOCTYPE weblogic-application PUBLIC '-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-application_2_0.dtd'>
    <weblogic-application>
         <classloader-structure>
              <module-ref>
                   <module-uri>hssWebApp.war</module-uri>
              </module-ref>
              <module-ref>
                   <module-uri>StaticInfoBean/StaticInfoBean.jar</module-uri>
              </module-ref>
              <module-ref>
                   <module-uri>HSSGWSBean/HSSGWSBean.jar</module-uri>
              </module-ref>
         </classloader-structure>
    </weblogic-application>

  • ClassCastException at narrow (Servlet/EJB)

    Hi
    I am new to this EJB concept.
    I try to use an EJB in a servlet but I have a ClassCastException thrown by the narrow method.
    I've already looked through the forums , but I haven't seen a solution for me.
    I use JBOSS-3.0.8 and TOMCAT-4.0.1.
    I include the client jar file generated by the deploytool in my client classpath.
    Here is the part of the servlet calling the EJB:
    Properties props= new Properties();
    props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    try {
    Context jndiContext = new InitialContext(props);
    System.out.println("Lookup");
    Object object = jndiContext.lookup("ejb/eltUtil");
    System.out.println("Object =>" + object.getClass()+"<=");
    System.out.println("Object =>" + object.toString()+"<=");
    System.out.println("PortableRemoteObject");
    UtilHome lUtilHome = (UtilHome)PortableRemoteObject.narrow(object,UtilHome.class);
    Here is the result in the jsp page:
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
         at fr.gouv.defense.cimd.authentification.servlet.ServletListeUtil.doGet(ServletListeUtil.java:87)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:484)
    And the log message in Tomcat:
    Lookup
    Object =>class org.jnp.interfaces.MarshalledValuePair<=
    Object =>org.jnp.interfaces.MarshalledValuePair@53cdaa<=
    PortableRemoteObject
    When I run the code in a Client interface in Eclipse, that works and the log is :
    Lookup
    Objet =>class $Proxy0
    Objet =>ejb/eltUtilHome
    PortableRemoteObject
    I don't know what to do.
    Does anybody got the answer?
    Thanks.

    even if isAssignableFrom returns false, still it can work.....
    here is how
    Object notificationServiceObject = initialContext.lookup(NotificationServiceHome.JNDI_NAME);          
    //Key Step
    Object notificationServiceRawObject = ((org.jnp.interfaces.MarshalledValuePair)
    notificationServiceObject).get();
    NotificationServiceHome notificationServiceHome =
              (NotificationServiceHome)javax.rmi.PortableRemoteObject.narrow
    (notificationServiceRawObject,NotificationServiceHome.class);
    NotificationService notificationService = notificationServiceHome.create();

  • Java.lang.ClassCastException PortableRemoteObject.narrow(PortableRemoteObje

    Hi,
    I have a problem with a JNDI -lookup() using the CORBA namig system.
    After looking up: System.out.println( lookup("jndi-name") );
    I get an IOR: IOR:0000000000000053524d493a...............
    ok
    then I print out the name and the package of this object:
    Object o = lookup("jndi-name");
    System.out.println("name of o : " + o.getClass().getName());
    System.out.println("package of o : " + o.getClass().getPackage());
    and get:
    name of o : com.sun.corba.ee.impl.corba.CORBAObjectImpl
    package of o : package com.sun.corba.ee.impl.corba
    I expected the type of a Home-Interface, so that i could narrow the object o:
    PortableRemoteObject.narrow( o , classname);
    and the result is a:
    java.lang.ClassCastException
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)........
    What's wrong

    The most likely reason is that the stubs for that home interface are not being found. Double-check your classpath to make sure they are available to the code at runtime.
    -ken

  • I get a ClassCastException when narrow

    InitialContext ctx = new InitialContext();
    Object objref = ctx.lookup("hosp");
    homehospfile = (hospfileHome)PortableRemoteObject.narrow(objref,hospfileHome.class);
    My code is above.
    If I wrote it in a servlet, it works fine, but if I wrote it in an application, it throw a ClassCastException on the line of narrow.
    So I think it's not a problem of deployment.
    I see some people encounter this problem in the Forum, but no solution is useful for me.
    Could anyone help?
    error message:
    java.lang.ClassCastException
    at com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(Porta
    bleRemoteObject.java:296)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at NewFile.init(newFile.java:32)
    at JFrame1.JButton5_actionPerformed(JFrame1.java:587)
    at JFrame1$SymAction.actionPerformed(JFrame1.java:539)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
    50)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1504)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:378)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:216)
    at java.awt.Component.processMouseEvent(Component.java:3717)
    at java.awt.Component.processEvent(Component.java:3546)
    at java.awt.Container.processEvent(Container.java:1164)
    at java.awt.Component.dispatchEventImpl(Component.java:2595)
    at java.awt.Container.dispatchEventImpl(Container.java:1213)
    at java.awt.Component.dispatchEvent(Component.java:2499)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
    at java.awt.Container.dispatchEventImpl(Container.java:1200)
    at java.awt.Window.dispatchEventImpl(Window.java:912)
    at java.awt.Component.dispatchEvent(Component.java:2499)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
    at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
    3)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

    Hi all,
    I am very new to java, having the same problem specified above, as the sol u suggested to put the stub into clients classpath then pls also tell what's this stub is?

  • ClassCastException in narrow(...)

    I am trying to run a simple stand-alone client that will look up a bean and get a reference to the home interface of that bean.
    The code looks like this:
    System.setProperty("java.naming.provider.url",
                   "iiop://localhost:1050");
    Context jndiContext = new InitialContext();
    ref = jndiContext.lookup("ResourceName");
    System.out.println("Lookup is complete...");
    MyResourceHome home = (MyResourceHome)
    PortableRemoteObject.narrow (ref,MyResourceHome.class);
    And the exception I get is this:
    lookup is complete...
    Class of ref: com.sun.corba.ee.internal.iiop.CDRInputStream_1_0$1
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unkno
    wn Source)
    at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
    at TestClient.main(TestClient.java:34)
    What is wrong?
    What do I have to do?
    Regards
    Stefan

    The problem is that the stubs and skels that are generated are not put in the same package as the Bean class files. ie Session.class Bean.Class Home.class. In other words your stubs are looked up in the same package as your bean. But the SunOne appclient jar that is generated on deployment puts the stubs and skels in the root directory of the jar. Oops. The stubs are actually located on the lookup not on the narrow so if you get the com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1 back from the lookup you are already dead. Cheers.

  • Why do I get a ClassCastException?

    Hello!
    I'm playing around with hibernate, axis2 and Weblogic 8.1.6 and I got I really tricky problem.
    My Weblogic 8.1.6 got consist of 3 servers.
    1 Adminserver (myserver)
    1 Managedserver (ejbserver)
    1 Managedserver (webserviceserver)
    My play_around_example is built around a database called names in a mysql-databas.
    To access data I got a package called nameshibernate.jar, that works fine used from an standalone application called namesjavaapplication.jar.
    (namesjavaapplication->nameshibernate->database)
    I also got an ejb in a packaged called namesejb.jar that uses the nameshibernate.jar. The namesejb.jar is deployed under "Ejb Modules" and the target is "ejbserver". If I call the ejb from my standalone application called namesjavaapplication.jar it works fine.
    (namesjavaapplication->namesejb->nameshibernate->database)
    I also got an webserviceapplication that uses axis2 in a aar-file called nameswebservice.aar. This application uses the namesejb.jar. The Axis2-server is deployed in the server under "Web Application Modules" and the target is "webserviceserver". In this Axis2-server the nameswebservice.aar is deployed. This i supposed to work like:
    (namesjavaapplication->nameswebservice->namesejb->nameshibernate->database)
    If I call the webservice from my standalone application called namesjavaapplication.jar I get a calsscast exception:
    java.lang.ClassCastException: Cannot narrow remote object to namesejb.client.NameManagerEJBHome
    I really can not find out the problem since it works fine if I go directly to the ejb like:
    (namesjavaapplication->namesejb->nameshibernate->database)
    Below is the method inside my standalone application that calls the ejb directly.
    This is the code that works:
    (namesjavaapplication->namesejb->nameshibernate->database)
         public void getNamesEJB() throws Exception
              try
                   System.out.println("getNamesEJB start");
                   Context context = getWebLogicInitialContext();
                   Object object = context.lookup("namesejb/client/NameManagerEJBHome");
                   System.out.println("\t1: " + object.getClass().getName());
                   Class c = Class.forName("namesejb.client.NameManagerEJBHome");
                   System.out.println("\t2: " + c.getName());
                   System.out.println("\t3: " + NameManagerEJBHome.class.getName());
                   System.out.println("\t4: " + (object instanceof NameManagerEJBHome));
                   System.out.println("\tjava.class.version: " + System.getProperty("java.class.version"));
                   System.out.println("\tjava.class.path: " + System.getProperty("java.class.path"));
                   System.out.println("\tjava.library.path: " + System.getProperty("java.library.path"));
                   System.out.println("\tjava.compiler: " + System.getProperty("java.compiler"));
                   System.out.println("\tjava.ext.dirs: " + System.getProperty("java.ext.dirs"));
                   System.out.println("\tuser.dir: " + System.getProperty("user.dir"));
                   System.out.println("\tjava.home: " + System.getProperty("java.home"));
                   if(object instanceof namesejb.server.NameManagerSessionBean)
                        System.out.println("\t"+ ((namesejb.server.NameManagerSessionBean)object).getSerialVersionUID() );
                   else
                        System.out.println("\tNOT instanceof NameManagerSessionBean");
                   NameManagerEJBHome nameManagerEJBHome = (NameManagerEJBHome)PortableRemoteObject.narrow(object, NameManagerEJBHome.class);
                   NameManangerEJBObject nameManangerEJBObject = nameManagerEJBHome.create();
         String nameString = "";
                   List names = nameManangerEJBObject.getNames();
         for (int i = 0; i < names.size(); i++)
         Name theName = (Name) names.get(i);
         nameString = nameString + "\n" + theName.getName();
         textAreaEJB.setText(nameString);
              catch(RemoteException e)
                   e.printStackTrace();
              catch(NamingException e)
                   e.printStackTrace();
              catch(Exception e)
                   e.printStackTrace();
    From this I get this output:
    getNamesEJB start
    1: namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
    2: namesejb.client.NameManagerEJBHome
    3: namesejb.client.NameManagerEJBHome
    4: true
    java.class.version: 50.0
    java.class.path: namesjavaapplication.jar
    java.library.path: /home/fredrik/Applications/Java/Java_ee_sdk_5-04/jd k/jre/lib/i386/server:/home/fredrik/Applications/Java/Java_ee_sdk_5-04 /jdk/jre/lib/i386:/home/fredrik/Applications/Java/Java_ee_sdk_5-04/jdk /jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
    java.compiler: null
    java.ext.dirs: /home/fredrik/Applications/Java/Java_ee_sdk_5-04/jdk/jr e/lib/ext:/usr/java/packages/lib/ext
    user.dir: /home/fredrik/eclipse_workspace/namesjavaapplication
    java.home: /home/fredrik/Applications/Java/Java_ee_sdk_5-04/jdk/jre
    NOT instanceof NameManagerSessionBean
    Below is my methods inside the ejb:
         public void ejbCreate()
              try
                   Class c = Class.forName("namesejb.client.NameManagerEJBHome");
                   System.out.println("1: " + c.getName());
                   System.out.println("2: " + NameManagerEJBHome.class.getName());
                   System.out.println("java.class.version: " + System.getProperty("java.class.version"));
                   System.out.println("java.class.path: " + System.getProperty("java.class.path"));
                   System.out.println("java.library.path: " + System.getProperty("java.library.path"));
                   System.out.println("java.compiler: " + System.getProperty("java.compiler"));
                   System.out.println("java.ext.dirs: " + System.getProperty("java.ext.dirs"));
                   System.out.println("user.dir: " + System.getProperty("user.dir"));
              catch(Exception e)
                   System.out.println(e.getMessage());
                   e.printStackTrace();
         public ArrayList getNames() throws Exception {
              Class c = Class.forName("namesejb.client.NameManagerEJBHome");
              System.out.println("4 " + c.getName());
              NameManager nameManager = new NameManager();
              return nameManager.getNames();
    From these methods I get this output from the ejbserver:
    1: namesejb.client.NameManagerEJBHome
    2: namesejb.client.NameManagerEJBHome
    java.class.version: 48.0
    java.class.path:/home/fredrik/Applications/bea/jrockit81sp6_142_10/lib/tools.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic_sp.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic.jar::/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbserver44.jar:/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/rt.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/webservices.jr:
    java.library.path:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386/jrockit:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/../lib/i386:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686/oci920_8
    java.compiler: null
    java.ext.dirs: /home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/ext
    user.dir: /home/fredrik/Applications/bea/user_projects/domains/mydomain
    4 namesejb.client.NameManagerEJBHome
    THIS WORKS FINE
    Below is the method inside my webservice that calls the ejb directly.
    This is the code that throws the Exception:
    (namesjavaapplication->nameswebservice->namesejb->nameshibernate->database)
         public String getNamesWSEJB() throws Exception
              String errorMessage = "Error: ";
              try
                   System.out.println("getNamesWSEJB start");
                   Context context = getWebLogicInitialContext();
                   Object object = context.lookup("namesejb/client/NameManagerEJBHome");
                   System.out.println("\t1: " + object.getClass().getName());
                   Class c = Class.forName("namesejb.client.NameManagerEJBHome");
                   System.out.println("\t2: " + c.getName());
                   System.out.println("\t3: " + NameManagerEJBHome.class.getName());
                   System.out.println("\t4: " + (object instanceof NameManagerEJBHome));
                   System.out.println("\tjava.class.version: " + System.getProperty("java.class.version"));
                   System.out.println("\tjava.class.path: " + System.getProperty("java.class.path"));
                   System.out.println("\tjava.library.path: " + System.getProperty("java.library.path"));
                   System.out.println("\tjava.compiler: " + System.getProperty("java.compiler"));
                   System.out.println("\tjava.ext.dirs: " + System.getProperty("java.ext.dirs"));
                   System.out.println("\tuser.dir: " + System.getProperty("user.dir"));
                   System.out.println("java.home: " + System.getProperty("java.home"));
                   if(object instanceof namesejb.server.NameManagerSessionBean)
                        System.out.println("\t"+ ((namesejb.server.NameManagerSessionBean)object).getSerialVersionUID() );
                   else
                        System.out.println("\tNOT instanceof NameManagerSessionBean");
                   NameManagerEJBHome nameManagerEJBHome = (NameManagerEJBHome)PortableRemoteObject.narrow(object, NameManagerEJBHome.class);
                   NameManangerEJBObject nameManangerEJBObject = nameManagerEJBHome.create();
         String nameString = "";
                   List names = nameManangerEJBObject.getNames();
                   for (int i = 0; i < names.size(); i++)
                        Name theName = (Name) names.get(i);
                        nameString = nameString + "\n" + theName.getName();
                   return nameString;
              catch(RemoteException e)
                   errorMessage = errorMessage + e.getMessage();
                   e.printStackTrace();
              catch(NamingException e)
                   errorMessage = errorMessage + e.getMessage();
                   e.printStackTrace();
              catch(Exception e)
                   errorMessage = errorMessage + e.getMessage();
                   e.printStackTrace();
              return errorMessage;
    1: namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
    2: namesejb.client.NameManagerEJBHome
    3: namesejb.client.NameManagerEJBHome
    4: false
    java.class.version: 48.0
    java.class.path:/home/fredrik/Applications/axis2-1.3/lib/jalopy-1.5rc3.jar:/home/fredrik/Applications/bea/jrockit81sp6_142_10/lib/tools.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic_sp.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/weblogic.jar::/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbserver44.jar:/home/fredrik/Applications/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/rt.jar:/home/fredrik/Applications/bea/weblogic81/server/lib/webservices.jar:
    java.library.path: /home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386/jrockit:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/i386:/home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/../lib/i386:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686:/home/fredrik/Applications/bea/weblogic81/server/lib/linux/i686/oci920_8
    java.compiler: null
    java.ext.dirs: /home/fredrik/Applications/bea/jrockit81sp6_142_10/jre/lib/ext
    user.dir: /home/fredrik/Applications/bea/user_projects/domains/mydomain
         NOT instanceof NameManagerSessionBean
    java.lang.ClassCastException: Cannot narrow remote object to namesejb.client.NameManagerEJBHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at nameswebservices.NamesWebService.getNamesWSEJB(NamesWebService.java:49)
    at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
            at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
            at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:165)
            at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
            at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
            at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
            at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
            at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
            at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
            at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    I really can not find out what might be the problem since it works to call tje ejb from a standalone application.
    The "same" code executed from a webservice throws the exception.
    One strange thing that I notice is that from the standalone the java.class.version gets 50.0 and from the webserver it gets 48.0 But the standalone uses 1.6 when I run it and the Weblogic uses 1.4. (I do not think that weblogic can run with 1.6)
    Pretty long thread but I hope for some mercy!
    Best regards
    Fredrik                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hello Thok, this code is from a quistion in a studybook for preparation of the SCJP 5.0 exam.
    When i compile i get this warning:
    Shapes.java:13: warning: [unchecked] unchecked cast
    found   : java.util.ArrayList
    required: java.util.ArrayList<generics.Rectangle>
            ArrayList <Rectangle> c = (ArrayList<Rectangle>) b;
                                                             ^
    1 warningWhen running this line causes an exception:
                for ( Rectangle o : c){My questions are
    How do i re-write the code so that i will get an warning and exception free program?
    Tnx Auke

  • ClassCastException when I access an EJB from a remote EJB in WL 8.1

    I am using WebLogic 8.1 and am trying to lookup the home interface for an EJB (_ejbRemote_)
    from another EJB (_ejbCurrent_). They are deployed in seperate EARs. When I bundle
    the home and remote interfaces for ejbRemote in the EAR file that ejbCurrent
    is deployed in, everything works fine. But I need to be able to configure ejbRemote
    at run time and my customers don't want to have to bundle their classes in my
    EAR. So I invoke a custom classloader (of type java.net.URLClassLoader) that will
    load the home and remote interface classes for ejbRemote from a configurable
    location at runtime. This finds the classes no problem, and the InitialContext.lookup()
    returns a stub, but I get a 'java.lang.ClassCastException: Cannot narrow remote
    object' error when I call PortableRemoteObject.narrow(home, homeClass);
    The code looks like:
    // Assume EJBHomeStr = "com.foo.TestHome" in this case
    // Load the home interface class. This works.
    Class homeClass = urlClassLoader.loadClass(EJBHomeStr);
    // Lookup the home interface. This works.
    Object lookedUpHomeObject = initialContext.lookup(JNDIName);
    // This fails.
    Object homeObject = PortableRemoteObject.narrow(lookedUpHomeObject, homeClass);
    And the weblogic error looks like
    ... ; nested exception is:
    java.lang.ClassCastException: Cannot narrow remote object to com.foo.TestHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteO
    bjectDelegateImpl.java:219)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at ...[the rest is just my application code stack...]
    When I log the ClassLoaders for the affected objects, using getClass().getClassLoader(),
    I get:
    <snippet from log follows>
    getClass().getClassLoader(): weblogic.utils.classloaders.GenericClassLoader@667da1
    finder:
    weblogic.utils.classloaders.MultiClassFinder@db9199 annotation: myEJBApp@
    homeClass.getName(): com.foo.TestHome classloader = java.net.URLClassLoader@4f1707
    lookedUpHomeObject.getClass().getName(): com.foo.Test_EJB_kx82zy_HomeImpl_810_WLStub
    classloader = weblogic.utils.classloaders.GenericClassLoader@667da1
    finder: weblogic.utils.classloaders.MultiClassFinder@db9199 annotation: myEJBApp@
    <end snippet from log>
    So it appears that since the looked up Stub was loaded by the WebLogic classloader
    and the actual Home class was loaded by my URLClassLoader, the narrow() can't
    reconcile the two. I have tried both rmic and the Weblogic appc command to pre-generate
    the stubs, which I put in the same JAR as my home and remote interface classes
    and load with my custom classloader. But the standard stub (generated by either
    rmic or appc) is named TestHomeStub.class and Weblogic is ignoring those and
    making a class with the name Test_EJB_kx82zy_HomeImpl_810_WLStub, as shown above.
    I have also tried to put the remote interface classes and stubs in the System
    classpath using the -classpath option when I start WebLogic, but same result.
    The question is, Is there a way in WebLogic to communicate with a remote EJB in
    a seperate EAR without bundling anything about that remote EAR in my EAR? Or is
    there something I've missed? I need to keep my application J2EE compliant, meaning
    I can't hardcode any AppServer-specific code in my application.
    Thanks.

    Hi Jon,
    Glad to hear that.
    Regards,
    Slava Imeshev
    "Jon Sutula" <[email protected]> wrote in message news:[email protected]...
    >
    I fixed the problem. It turns out I didn't need to use a custom classloader at
    all, I just use Reflection directly on the classes ruturned from my JNDI lookup.
    So when I lookup the home class, I don't need to narrow or cast it, I just use
    Reflection to invoke the "create" method. Then I use the object that I get from
    create and directly invoke whatever method on it I need, again using Reflection.
    And that works.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Jon,
    The problem is, this class is not available for the classloader
    running your "main code".
    You can try to hack the into the thread context class loader:
    Thread thread = Thread.currentThread();
    ContextClassLoader originalClassLoader = thread.getContextClassLoader();
    try {
    YourURLClassloader yourClassLoader = new
    YourURLClassloader(originalClassLoader);
    thread.setContextClassLoader(yourClassLoader );
    // your code goes here
    } finally {
    // Don't forget to restore it !!!
    thread.setContextClassLoader(originalClassLoader);
    Be very cautious. If you fail to restore the original context class loader,
    you will likely have to restart the server.
    Hope this helps.
    Regards,
    Slava Imeshev
    "Jon Sutula" <[email protected]> wrote in message news:[email protected]...
    I am using WebLogic 8.1 and am trying to lookup the home interfacefor an EJB (_ejbRemote_)
    from another EJB (_ejbCurrent_). They are deployed in seperate EARs.When I bundle
    the home and remote interfaces for ejbRemote in the EAR file that
    ejbCurrent
    is deployed in, everything works fine. But I need to be able to configure
    ejbRemote
    at run time and my customers don't want to have to bundle their classesin my
    EAR. So I invoke a custom classloader (of type java.net.URLClassLoader)that will
    load the home and remote interface classes for ejbRemote from a configurable
    location at runtime. This finds the classes no problem, and the InitialContext.lookup()
    returns a stub, but I get a 'java.lang.ClassCastException: Cannot narrowremote
    object' error when I call PortableRemoteObject.narrow(home, homeClass);
    The code looks like:
    // Assume EJBHomeStr = "com.foo.TestHome" in this case
    // Load the home interface class. This works.
    Class homeClass = urlClassLoader.loadClass(EJBHomeStr);
    // Lookup the home interface. This works.
    Object lookedUpHomeObject = initialContext.lookup(JNDIName);
    // This fails.
    Object homeObject = PortableRemoteObject.narrow(lookedUpHomeObject,homeClass);
    And the weblogic error looks like
    ... ; nested exception is:
    java.lang.ClassCastException: Cannot narrow remote object tocom.foo.TestHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteO
    bjectDelegateImpl.java:219)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at ...[the rest is just my application code stack...]
    When I log the ClassLoaders for the affected objects, using getClass().getClassLoader(),
    I get:
    <snippet from log follows>
    getClass().getClassLoader(): weblogic.utils.classloaders.GenericClassLoader@667da1
    finder:
    weblogic.utils.classloaders.MultiClassFinder@db9199 annotation: myEJBApp@
    homeClass.getName(): com.foo.TestHome classloader = java.net.URLClassLoader@4f1707
    lookedUpHomeObject.getClass().getName(): com.foo.Test_EJB_kx82zy_HomeImpl_810_WLStub
    classloader = weblogic.utils.classloaders.GenericClassLoader@667da1
    finder: weblogic.utils.classloaders.MultiClassFinder@db9199 annotation:myEJBApp@
    <end snippet from log>
    So it appears that since the looked up Stub was loaded by the WebLogicclassloader
    and the actual Home class was loaded by my URLClassLoader, the narrow()can't
    reconcile the two. I have tried both rmic and the Weblogic appc commandto pre-generate
    the stubs, which I put in the same JAR as my home and remote interfaceclasses
    and load with my custom classloader. But the standard stub (generatedby either
    rmic or appc) is named TestHomeStub.class and Weblogic is ignoringthose and
    making a class with the name Test_EJB_kx82zy_HomeImpl_810_WLStub, asshown above.
    I have also tried to put the remote interface classes and stubs inthe System
    classpath using the -classpath option when I start WebLogic, but sameresult.
    The question is, Is there a way in WebLogic to communicate with a remoteEJB in
    a seperate EAR without bundling anything about that remote EAR in myEAR? Or is
    there something I've missed? I need to keep my application J2EE compliant,meaning
    I can't hardcode any AppServer-specific code in my application.
    Thanks.

  • Cannot narrow object??

    Hi,
    I previously had the following fragment of code inside a servlet (which worked fine):
    Context ctx = new InitialContext();
    BeanEJB beanEJB = null;
    BeanEJBHome beanHome = null;
    Object obj = ctx.lookup("ejb/BeanEJB");
    beanHome = (BeanEJBHome ) PortableRemoteObject.narrow(obj, BeanEJBHome.class);However, I moved the above code to the run() method of a new thread I created and now the PortableRemoteObject.narrow() call throws a ClassCastException.
    Can anyone help?
    Thank you!

    alexandre cuenca <> writes:
    Do you have A's client jar in B's package? You might need this unless
    they are in the same ear. Otherwise it looks like a classloding bug.
    andy
    Hello,
    <br><br>
    My application is composed of 2 different package A and B. All deployed in the same server.<br>
    - A implements EJBA<br>
    - B implements EJBB<br>
    EJBA is registred in the JNDI tree as ejb.a<br><br>
    When EJBB runs these line of code :<br>
    Object obj = context.lookup("ejb.a");<br>
    System.out.println("ref:" + obj); // ref : com.coface.util.ejb.tools_<b>cvb9yr</b>_HomeImpl@a64642<br>
    AHome home = (AHome) PortableRemoteObject.narrow(obj, AHome.class);<br>
    Narrow raises :<br>
    java.lang.ClassCastException: Cannot narrow remote object to AHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    <br><br><br>
    I have no idea what can be wrong and how I can debug this kind of exception.<br>
    I just noticed this odd "cvb9yr" in the looked up instance class. Thought I am not sure how this name is generated.<br>
    Anyone could help me to track down the cause of this exception?<br><br>
    Thanks<br>
    <br>
    Alexandre
    Message was edited by:
    acuenca--

  • Cannot narrow remote object error?

    Hello,
    <br><br>
    My application is composed of 2 different package A and B. All deployed in the same server.<br>
    - A implements EJBA<br>
    - B implements EJBB<br>
    EJBA is registred in the JNDI tree as ejb.a<br><br>
    When EJBB runs these line of code :<br>
    Object obj = context.lookup("ejb.a");<br>
    System.out.println("ref:" + obj); // ref : com.coface.util.ejb.tools_<b>cvb9yr</b>_HomeImpl@a64642<br>
    AHome home = (AHome) PortableRemoteObject.narrow(obj, AHome.class);<br>
    Narrow raises :<br>
    java.lang.ClassCastException: Cannot narrow remote object to AHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    <br><br><br>
    I have no idea what can be wrong and how I can debug this kind of exception.<br>
    I just noticed this odd "cvb9yr" in the looked up instance class. Thought I am not sure how this name is generated.<br>
    Anyone could help me to track down the cause of this exception?<br><br>
    Thanks<br>
    <br>
    Alexandre
    Message was edited by:
    acuenca

    alexandre cuenca <> writes:
    Do you have A's client jar in B's package? You might need this unless
    they are in the same ear. Otherwise it looks like a classloding bug.
    andy
    Hello,
    <br><br>
    My application is composed of 2 different package A and B. All deployed in the same server.<br>
    - A implements EJBA<br>
    - B implements EJBB<br>
    EJBA is registred in the JNDI tree as ejb.a<br><br>
    When EJBB runs these line of code :<br>
    Object obj = context.lookup("ejb.a");<br>
    System.out.println("ref:" + obj); // ref : com.coface.util.ejb.tools_<b>cvb9yr</b>_HomeImpl@a64642<br>
    AHome home = (AHome) PortableRemoteObject.narrow(obj, AHome.class);<br>
    Narrow raises :<br>
    java.lang.ClassCastException: Cannot narrow remote object to AHome
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    <br><br><br>
    I have no idea what can be wrong and how I can debug this kind of exception.<br>
    I just noticed this odd "cvb9yr" in the looked up instance class. Thought I am not sure how this name is generated.<br>
    Anyone could help me to track down the cause of this exception?<br><br>
    Thanks<br>
    <br>
    Alexandre
    Message was edited by:
    acuenca--

  • WLS10 and Stateless Session Bean

    I tried to create EJB3 application example.
    1. Created Stateless Session Bean that implements Remote and Local interfaces:
    Session Bean code:
    package com.session;
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    @Stateless(mappedName="SessionBeanService")
    @Remote(ISessionBeanRemote.class)
    @Local(ISessionBeanLocal.class)
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class SessionBean implements ISessionBeanLocal,
    ISessionBeanRemote
    public String reply(){
    return "MySessionBean - success !!!";
    Remote Interface code :
    package com.session;
    public interface ISessionBeanRemote
    public String reply();
    Local Interface code:
    package com.session;
    public interface ISessionBeanLocal
    public String reply();
    application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/application_5.xsd"
         version="5">
         <display-name>EJB3 Sample Application</display-name>
         <module>
         <ejb>beans.jar</ejb>
         </module>
    </application>
    weblogic-application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-application PUBLIC
         "-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN"
         "http://www.bea.com/ns/weblogic/90/weblogic-application.xsd">
    <weblogic-application>
              <classloader-structure>
                   <module-ref>
                        <module-uri>beans.jar</module-uri>
                   </module-ref>
              </classloader-structure>
    </weblogic-application>
    2. I packaged classes into EAR file and deployed to WLS10.
    I didn't include any weblogic specific XML descriptors besides weblogic-application.jar.
    My client code lookes as follows:
    public void test(){
    Context context = getMyServerContext();
    // THIS JNDI NAME I SEE ON MY SERVER JNDI TREE
    String jndiName = "sessionbeansbeans_jarSessionBean_ISessionBeanRemote";
    Object obj;
    obj = context.lookup(jndiName);
    System.out.println(" obj class : " + obj.getClass().getName());
    ISessionBeanRemote remote = (ISessionBeanRemote) PortableRemoteObject.narrow(
    obj, ISessionBeanRemote.class );
    String res = remote.reply();
    System.out.println("res : "+res);
    I get an Exception:
    Exception occurred!
    java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
         at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
         at ca.cgi.mvest.test.server.wms.GlFacadeTest.runTest(GlFacadeTest.java:91)
         at ca.cgi.mvest.test.server.wms.GlFacadeTest.<init>(GlFacadeTest.java:53)
         at ca.cgi.mvest.test.server.wms.GlFacadeTest.main(GlFacadeTest.java:151)
    java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
    My server console have the following output:
    Root cause of ServletException.java.lang.NoClassDefFoundError: com/session/SessionBean_7pp7ls_ISessionBeanRemot
    eIntf
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
    at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericCla
    ssLoader.java:338)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:291)
    Truncated. see log file for complete stacktrace
    Server logs a problem already on the line when I do lookup
    on JNDI name even before narrow();
    It looks like my EAR was missing something. But server never complained during deployment.
    May be someone can direct me to a real sample of Weblogic10-ejb3.0 application, since examples that come with WLS 10 intallation combersome and do not follow
    docmentation.
    Thanks in advance for any suggestion.

    Hello Freind
    The main different b\w stateful and statless is that stateful maintain state of method conversation means it has record that which method call before this method
    but in case of stateless conversation state does not saved second different we can say that create method in stateless having no parameter but statefull having parameter I think u can understand easily
    With Best Regards
    Rajesh Pandey
    email :[email protected]
    url :-- http://www.sixthquadrant.com
    Mob :-- 9811903737
    Delhi India

  • Security restriction in LoginModule?

    I have implemented my own LoginModule. In the module, I try to reference an
    EJB.
    When I call PortableRemoteObject.narrow(), I get the following error:
    java.lang.ClassCastException: Cannot narrow remote object to
    net.lm.uams.service.ejb.UserAccountManagementServiceRemoteHome
    Is this because of some security restriction related to the LoginModule, or
    do you think that the problem stems from having two copies of the same EJB
    classes? If the problem is related to having two copies of the classes, how
    would I go about referencing the classes from the LoginModule without having
    them in that .jar file?
    Note that this problem isn't at weblogic startup - I have written code to
    handle this initial administrator authentication. The problem occurs later
    during form-based authentication. The publicly available pages/EJBs work
    fine.
    using WLS 7.0 on win2000.
    I'd appreciate any pointers.
    thanks
    Sean

    Bill,
    I haven't added anything at all to the classpath in my startup script. WL
    just picks up my jar in WL_HOME/server/lib/mbeantypes. I've done a
    System.getProperty() for the classpath at runtime, and it doesn't include my
    ejb.jar.
    Yesterday, I re-wrote my class to do a straight JDBC lookup to the database
    for username/pwd/roles. It's not the solution I'd prefer, because it
    introduces a reliance on the underlying database schema into the
    LoginModule. But, I don't really have time at the moment to spend
    experimenting with my original idea. Hopefully I can come back to it in the
    future.
    thanks again,
    Sean
    "William Kemp" <[email protected]> wrote in message
    news:[email protected]...
    Each enterprise application has it's own classloader hierarchy, whichmeans the
    ejbs and webapps in an EAR file are loaded by a classloader hierarchy thatis
    parented by the boot, system, and application classloaders that load theboot
    classes, java core classes, and weblogic.jar classes, and any classes thatyou
    put in the classpath when you start weblogic. The EAR file classes areloaded
    below these, hierarchically speaking.
    I am assuming that you have put your LoginModule classfile in the javaclasspath
    when you start the server. Are you perhaps putting the jar file generatedby the
    ejbc process in the java classpath when you start the server, too? Couldyou
    post your start script? Also, remember that the start script that comeswith
    weblogic prepends it's jars and what not to the existing classpath. So,that
    while you may not be explicitly adding the ejb jar file to the classpathin the
    start script, it may be already in the classpath in the currentenvironment and
    the start script is tacking that on at the end.
    Just a guess.
    Bill
    Sean Ryan wrote:
    Thanks for the response William. I have tried what you suggested, but
    the
    problem is still the same.
    If I do the jndi lookup without the narrow() part, I can execute methodson
    the resultant object using reflection. This is a bit of a hack, and not
    really a satisfactory solution.
    I have written a main() method in my class, and when I execute it (fromthe
    .jar), it can do the lookup and narrow without any difficulty.
    As I understand it, each container has its own classloader, however myclass
    is essentially executing from within weblogic. Is there a bit of a greyarea
    here in relation to class loading? Because, as I said my class worksfine
    when it is executing in a separate jvm.
    again, I would appreciate any input you can offer.
    Sean
    "William Kemp" <[email protected]> wrote in message
    news:[email protected]...
    If this was because of a security restriction, you would see a
    different
    Exception. Try putting just the compiled Home and Remote interfaces inthe
    classpath used by the LoginModule and not the jar file with thegenerated
    and
    compiled code for the stubs. You don't need them in the client becuase
    you
    are
    coding to the inteface, not the stubs.
    Bill
    Sean Ryan wrote:
    I have implemented my own LoginModule. In the module, I try to
    reference
    an
    EJB.
    When I call PortableRemoteObject.narrow(), I get the following
    error:
    >>>>
    java.lang.ClassCastException: Cannot narrow remote object to
    net.lm.uams.service.ejb.UserAccountManagementServiceRemoteHome
    Is this because of some security restriction related to theLoginModule,
    or
    do you think that the problem stems from having two copies of the
    same
    EJB
    classes? If the problem is related to having two copies of the
    classes,
    how
    would I go about referencing the classes from the LoginModule
    without
    having
    them in that .jar file?
    Note that this problem isn't at weblogic startup - I have written
    code
    to
    handle this initial administrator authentication. The problem occurslater
    during form-based authentication. The publicly available pages/EJBs
    work
    fine.
    using WLS 7.0 on win2000.
    I'd appreciate any pointers.
    thanks
    Sean

  • After upgrade of Weblogic 8.1 to 9.2 web application fails to function

    Hi,
    After spending days and days together to get the upgrade to complete and finally build the web application, when i now try to run the web application, the admin (note i am runing under weblogic workshop domain) server gives the following warnings when starting up and the application throws a lot of exceptions related to netui pageflows. Kindly help.
    <Jul 2, 2010 1:40:02 PM PDT> <Error> <WSRP-Consumer> <BEA-420731> <Exception [java.security.PrivilegedActionException: com.bea.wsrp.consumer.managemen
    t.portlet.ProxyPortletManagerException: java.lang.ClassCastException: com.bea.wsrp.services.persistence.internal.ProxyPortletPersistenceManagerImpl_fx
    ifd8_LocalHomeImpl] thrown while trying to do task [handleTimerNotification] in class [com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveList
    ener].
    java.security.PrivilegedActionException: com.bea.wsrp.consumer.management.portlet.ProxyPortletManagerException: java.lang.ClassCastException: com.bea.
    wsrp.services.persistence.internal.ProxyPortletPersistenceManagerImpl_fxifd8_LocalHomeImpl
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener.handleNotification(ProxyPortletRemoveListener.java:197)
    at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
    at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
    Truncated. see log file for complete stacktrace
    com.bea.wsrp.consumer.management.portlet.ProxyPortletManagerException: java.lang.ClassCastException: com.bea.wsrp.services.persistence.internal.ProxyP
    ortletPersistenceManagerImpl_fxifd8_LocalHomeImpl
    at com.bea.wsrp.consumer.management.ProxyPortletManagerImpl.getRemovableProxyPortlets(ProxyPortletManagerImpl.java:485)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener$ProxyPortletRemover.run(ProxyPortletRemoveListener.java:330)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener.handleNotification(ProxyPortletRemoveListener.java:197)
    Truncated. see log file for complete stacktrace
    java.lang.ClassCastException: com.bea.wsrp.services.persistence.internal.ProxyPortletPersistenceManagerImpl_fxifd8_LocalHomeImpl
    at com.bea.wsrp.consumer.management.AbstractAdapter.getLocalPPPM(AbstractAdapter.java:313)
    at com.bea.wsrp.consumer.management.AbstractAdapter.getProxyPortletPersistenceManager(AbstractAdapter.java:293)
    at com.bea.wsrp.consumer.management.ProxyPortletManagerImpl.getRemovableProxyPortlets(ProxyPortletManagerImpl.java:483)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener$ProxyPortletRemover.run(ProxyPortletRemoveListener.java:330)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    Truncated. see log file for complete stacktrace
    <Jul 2, 2010 1:40:04 PM PDT> <Error> <netuix> <BEA-423147> <Exception [java.lang.ClassCastException: Cannot narrow remote object com.bea.netuix.applic
    ation.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImpl@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationM
    anagerHome] thrown while trying to do task [initPortalPresentationManager] in class [com.bea.netuix.servlets.manager.PortalServlet].
    java.lang.ClassCastException: Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImp
    l@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationManagerHome
    at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
    at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at com.bea.netuix.servlets.manager.PortalServlet.initPortalPresentationManager(PortalServlet.java:418)
    Truncated. see log file for complete stacktrace
    <Jul 2, 2010 1:40:04 PM PDT> <Error> <netuix> <BEA-423393> <An exception was thrown while running PortalServlet.init: [ javax.servlet.ServletException
    : Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImpl@11ef9a9 to com.bea.netuix.
    application.manager.persistence.PortalPresentationManagerHome ].
    javax.servlet.ServletException: Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeI
    mpl@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationManagerHome
    at com.bea.netuix.util.ThrowServletException.throwServletException(ThrowServletException.java:28)
    at com.bea.netuix.servlets.manager.PortalServlet.initPortalPresentationManager(PortalServlet.java:430)
    at com.bea.netuix.servlets.manager.PortalServlet.initCommon(PortalServlet.java:378)
    at com.bea.netuix.servlets.manager.PortalServlet.reinitInternal(PortalServlet.java:234)
    at com.bea.netuix.servlets.manager.PortalServlet.initInternal(PortalServlet.java:225)
    Truncated. see log file for complete stacktrace
    java.lang.ClassCastException: Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImp
    l@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationManagerHome
    at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
    at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at com.bea.netuix.servlets.manager.PortalServlet.initPortalPresentationManager(PortalServlet.java:418)
    Truncated. see log file for complete stacktrace

    Hi,
    After spending days and days together to get the upgrade to complete and finally build the web application, when i now try to run the web application, the admin (note i am runing under weblogic workshop domain) server gives the following warnings when starting up and the application throws a lot of exceptions related to netui pageflows. Kindly help.
    <Jul 2, 2010 1:40:02 PM PDT> <Error> <WSRP-Consumer> <BEA-420731> <Exception [java.security.PrivilegedActionException: com.bea.wsrp.consumer.managemen
    t.portlet.ProxyPortletManagerException: java.lang.ClassCastException: com.bea.wsrp.services.persistence.internal.ProxyPortletPersistenceManagerImpl_fx
    ifd8_LocalHomeImpl] thrown while trying to do task [handleTimerNotification] in class [com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveList
    ener].
    java.security.PrivilegedActionException: com.bea.wsrp.consumer.management.portlet.ProxyPortletManagerException: java.lang.ClassCastException: com.bea.
    wsrp.services.persistence.internal.ProxyPortletPersistenceManagerImpl_fxifd8_LocalHomeImpl
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener.handleNotification(ProxyPortletRemoveListener.java:197)
    at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
    at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
    Truncated. see log file for complete stacktrace
    com.bea.wsrp.consumer.management.portlet.ProxyPortletManagerException: java.lang.ClassCastException: com.bea.wsrp.services.persistence.internal.ProxyP
    ortletPersistenceManagerImpl_fxifd8_LocalHomeImpl
    at com.bea.wsrp.consumer.management.ProxyPortletManagerImpl.getRemovableProxyPortlets(ProxyPortletManagerImpl.java:485)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener$ProxyPortletRemover.run(ProxyPortletRemoveListener.java:330)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener.handleNotification(ProxyPortletRemoveListener.java:197)
    Truncated. see log file for complete stacktrace
    java.lang.ClassCastException: com.bea.wsrp.services.persistence.internal.ProxyPortletPersistenceManagerImpl_fxifd8_LocalHomeImpl
    at com.bea.wsrp.consumer.management.AbstractAdapter.getLocalPPPM(AbstractAdapter.java:313)
    at com.bea.wsrp.consumer.management.AbstractAdapter.getProxyPortletPersistenceManager(AbstractAdapter.java:293)
    at com.bea.wsrp.consumer.management.ProxyPortletManagerImpl.getRemovableProxyPortlets(ProxyPortletManagerImpl.java:483)
    at com.bea.wsrp.consumer.management.portlet.ProxyPortletRemoveListener$ProxyPortletRemover.run(ProxyPortletRemoveListener.java:330)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    Truncated. see log file for complete stacktrace
    <Jul 2, 2010 1:40:04 PM PDT> <Error> <netuix> <BEA-423147> <Exception [java.lang.ClassCastException: Cannot narrow remote object com.bea.netuix.applic
    ation.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImpl@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationM
    anagerHome] thrown while trying to do task [initPortalPresentationManager] in class [com.bea.netuix.servlets.manager.PortalServlet].
    java.lang.ClassCastException: Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImp
    l@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationManagerHome
    at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
    at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at com.bea.netuix.servlets.manager.PortalServlet.initPortalPresentationManager(PortalServlet.java:418)
    Truncated. see log file for complete stacktrace
    <Jul 2, 2010 1:40:04 PM PDT> <Error> <netuix> <BEA-423393> <An exception was thrown while running PortalServlet.init: [ javax.servlet.ServletException
    : Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImpl@11ef9a9 to com.bea.netuix.
    application.manager.persistence.PortalPresentationManagerHome ].
    javax.servlet.ServletException: Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeI
    mpl@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationManagerHome
    at com.bea.netuix.util.ThrowServletException.throwServletException(ThrowServletException.java:28)
    at com.bea.netuix.servlets.manager.PortalServlet.initPortalPresentationManager(PortalServlet.java:430)
    at com.bea.netuix.servlets.manager.PortalServlet.initCommon(PortalServlet.java:378)
    at com.bea.netuix.servlets.manager.PortalServlet.reinitInternal(PortalServlet.java:234)
    at com.bea.netuix.servlets.manager.PortalServlet.initInternal(PortalServlet.java:225)
    Truncated. see log file for complete stacktrace
    java.lang.ClassCastException: Cannot narrow remote object com.bea.netuix.application.manager.persistence.jdbc.PortalPresentationManager_4ekhk0_HomeImp
    l@11ef9a9 to com.bea.netuix.application.manager.persistence.PortalPresentationManagerHome
    at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
    at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
    at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at com.bea.netuix.servlets.manager.PortalServlet.initPortalPresentationManager(PortalServlet.java:418)
    Truncated. see log file for complete stacktrace

Maybe you are looking for

  • Getting INTERNAL_ERROR while updating tasks in OIM

    Hi, I have written a custom connector and wrote tasks to update the attributes in the target system. After the approval workflow the user got provisioned to the target system and i am able to update all the attributes like firstname,lastname etc. I h

  • How do I get help with a malfunctioning Safari app on my iPad mini?

    I've been using the app successfully for quite some time. All of the sudden today, it started spontaneously closing. There is no warning or otherwise abnormal behavior. It simply shuts off. My device home screen appears, I re-open the app and it cont

  • PHOTOSHOP CS6 ON WINDOWS XP ??

    IS PHOTOSHOP CS6 EXTENDED (DUTCH VERSION) SUPPORTED ON WINDOWS XP  ??

  • Smartfrom print error

    THIS IS URGENT when iam giving print preview iam able to get it but when iam giving the print iam getting error called 'ERROR IN GENERATING SMARTFORM'  this program is already exsisting . i made some changes in the smartfrom in positioning for some o

  • Word "Logo" Appears on Titles When Exporting as Windows Media File

    Whenever exporting as a windows media file, the title pages are obscured by the word "logo" in large type across the screen. Is there a rendering step or other problem I am overlooking? It doesn't seemed to be a problem with other export formats -- b