Class Cast Exception in Portable Remote Object

Hai guys,
I am new to jsp.I have made a simple j2ee application in which i am getting class cast exception in PortableRemoteObject.narrow function.
The exception is:
org.apache.jasper.JasperException
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
The root cause is :
java.lang.ClassCastException
     com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
org.apache.jsp.registration_jsp._jspService(registration_jsp.java:59)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
The code of the file is :
<%@ page language="java" import="java.sql.*,pkg.*,javax.ejb.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.rmi.RemoteException" %>
<html>
<head>
<title></title>
</head>
<body bgcolor="CCCCFF">
<h1><center>Welcome to MyBank</center></h1>
<%
InitialContext initial = new InitialContext();
Object objref = initial.lookup("bankDSN");
pkg.mybankHome vi = (pkg.mybankHome)PortableRemoteObject.narrow(objref,pkg.mybankHome.class);
%>
</body>
</html>
I have many threads but i was not able to solve this problem.
It has been 2 to 3 weeks that i am struck in this error.
Plz help me with this.
Thanks in advance.
Edited by: vishal29 on Jul 13, 2008 10:04 PM

Hai DigitalDreamer,
Thanks for giving your valuable time to my question.
I have tried the code you gave me.
The answer for :
out.println(objref.getClass().getName());
that i got is :
javax.naming.Reference
And the answer for :
out.println(objref.getClass().getInterfaces());
that i got is :
[Ljava.lang.Class;@213b6e
Could you please tell me how this can help.
Actually i am new to jsp.
Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Remote Class cast Exception

    Greetings,
    I took my first steps into the RMI world. I managed to get a tutorial example working. Now I did my own RMI system, but I can`t get rid of this problem.
    - rmiregistry is running OK
    - my RMIServer is running OK
    but my RMIClient Throws: java.lang.ClassCastExceptionI took a closer look at the Object I receive on the client side, and it was:
    DBManager_Stub[RemoteStub [ref: [endpoint:[ ... [/b]
    Here are the code snippets:
    public interface DefaultDBManager extends java.rmi.Remote
    public class DBManager implements DefaultDBManagerIn my RMIServer:
    LocateRegistry.createRegistry(PORT);
    DefaultDBManager DB_MANAGER = new DBManager();
    UnicastRemoteObject.exportObject(((DefaultDBManager)DB_MANAGER));
    Naming.rebind(URL,DB_MANAGER);and in the client code:
    DBManager DB_MANAGER = (DBManager)Naming.lookup(URL);But the client code Throws Class cast Exception.
    What is it I`m not seeing here?
    Help appreciated,
    Eki

    and in the client code:
    DBManager DB_MANAGER = (DBManager)Naming.lookup(URL);You should be casting to the interface not the impl class.
    DefaultDBManager DB_MANAGER = (DefaultDBManager)Naming.lookup(URL);

  • 'Class Cast Exception' while invoking a EJB from a Servlet

              Hi,
              I am working on J2EE applications.I am using Webgain studio and weblogic server.I
              got a problem while invoking EJB from the servlet.
              While calling an EJB from the servlet, it is giving that "Class Cast Exception".This
              is because, the remote home reference is not able to type casted to the"Home Interface"
              of the EJB, even if I type casted explicitly. It is creating the context and able
              to identify the EJB with the JNDI name.
              Could please help me in solving this problem.I am pasting the code here.
              Thanks in advance,
              Dharma
              public void doGet(HttpServletRequest req, HttpServletResponse resp)
                   throws ServletException, IOException
                        resp.setContentType("text/html");
                        PrintWriter out = new PrintWriter(resp.getOutputStream());
              try
              Context context=getInitialContext();
              Object reference=context.lookup("ArlProjContractorAppletSession");
              ArlProjContractorAppletSessionHome home=(ArlProjContractorAppletSessionHome)PortableRemoteObject.narrow(reference,ArlProjContractorAppletSessionHome.class);
              //Exception is occuring in the above statement. It is unable
              //to cast to the home interface          
                        ArlProjContractorAppletSession the_ejb=null;
              try
              the_ejb=home.create();
              System.out.println("the_ejb = " + the_ejb.toString());
              catch(Exception e)
              e.printStackTrace();
              catch(Exception e)
              e.printStackTrace();
                        // to do: code goes here.
                        out.println("<HTML>");
                        out.println("<HEAD><TITLE>Contractor TimeTracker</TITLE></HEAD>");
                        out.println("<BODY>");
                        // to do: your HTML goes here.
                        out.println("</BODY>");
                        out.println("</HTML>");
                        out.close();
              

              I came across this kind of problem once. My problem went away after I upgraded
              from 5.1 SP6 to 5.1 SP8.
              "Dharma" <[email protected]> wrote:
              >
              >Hi,
              >
              >I am working on J2EE applications.I am using Webgain studio and weblogic
              >server.I
              >got a problem while invoking EJB from the servlet.
              >
              >While calling an EJB from the servlet, it is giving that "Class Cast
              >Exception".This
              >is because, the remote home reference is not able to type casted to the"Home
              >Interface"
              >of the EJB, even if I type casted explicitly. It is creating the context
              >and able
              >to identify the EJB with the JNDI name.
              >
              >Could please help me in solving this problem.I am pasting the code here.
              >
              >Thanks in advance,
              >Dharma
              >
              >
              >public void doGet(HttpServletRequest req, HttpServletResponse resp)
              >     throws ServletException, IOException
              >     {
              >          resp.setContentType("text/html");
              >          PrintWriter out = new PrintWriter(resp.getOutputStream());
              >
              > try
              > {
              >
              > Context context=getInitialContext();
              >
              > Object reference=context.lookup("ArlProjContractorAppletSession");
              >
              > ArlProjContractorAppletSessionHome home=(ArlProjContractorAppletSessionHome)PortableRemoteObject.narrow(reference,ArlProjContractorAppletSessionHome.class);
              >
              >//Exception is occuring in the above statement. It is unable
              >//to cast to the home interface          
              >
              >          ArlProjContractorAppletSession the_ejb=null;
              >
              > try
              > {
              > the_ejb=home.create();
              >
              > System.out.println("the_ejb = " + the_ejb.toString());
              >
              > }
              > catch(Exception e)
              > {
              > e.printStackTrace();
              > }
              > }
              > catch(Exception e)
              > {
              > e.printStackTrace();
              > }
              >          // to do: code goes here.
              >
              >          out.println("<HTML>");
              >          out.println("<HEAD><TITLE>Contractor TimeTracker</TITLE></HEAD>");
              >          out.println("<BODY>");
              >
              >          // to do: your HTML goes here.
              >
              >          out.println("</BODY>");
              >          out.println("</HTML>");
              >          out.close();
              >     }
              >
              >
              >
              >
              >
              

  • Oracle Arrays and getVendorConnection API and Class Cast Exception

    I 've gone through various threads relating to the topic of Oracle Arrays and the getVendorConnecton API call to avoid the class Cast Exception.. i ve used all these but am still facing the problem...
    I would appreciate it if some one could resolve the following queries :
    I am using Weblogic 8.1 SP5 with oracle 8i
    1. I read that the need to use the getVendorConnection API to make pl/sql proc calls with oracle arrays from the WL Server wont be required to avoid classCastException...
    I tried to use the connection from the WL connection pool ..but it didnot work....I used the getVendorConnection API ..which also doesnot seem to work..
    I got the Heurisitc Hazard exception...I used the Oracle 9i driver ie ojdbc14.jar ...after this the exception is not coming but still the code doesnt seem to work...
    the snippet of the code is pasted below :
    ~~~~~~~~~~~~~~~~~~~~~~~code is : ~~~~~~~~~~~~~~~~~~~
    /*below :
    logicalCon is the Connection from the WL connection pool
    JDBCcon is the JDBC connection. */
    <div> try </div>
    <div>{ </div>
    <div>
    <b>vendorConn</b> = ((WLConnection)logicalCon).getVendorConnection();
    </div>
    <div>
    //Calling the procedure
    </div>
    <div>
    //java.util.Map childMap1 = JDBCcon.getTypeMap();
    </div>
    <div>
    java.util.Map childMap1 = <b>vendorConn</b>.getTypeMap();
    </div>
    <div>
    childMap1.put("SST_ROUTE_ENTRY", Class.forName("svm.stport.ejb.StaticRouteEntry"));
    </div>
    <div>
    //JDBCcon.setTypeMap(childMap1);
    <b>vendorConn</b>.setTypeMap(childMap1);
    </div>
    <div>
    // Create an oracle.sql.ARRAY object to hold the values
    </div>
    <div>
    /*oracle.sql.ArrayDescriptor arrayDesc1 = oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", JDBCcon); */
    </div>
    <div>
    oracle.sql.ArrayDescriptor arrayDesc1 =
    oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", <b>vendorConn</b>); // here if i use the JDBCcon it works perfectly.... <u>^%^%^%</u>
    </div>
    <div>
    code to fill in the sst route entry array....
    .....arrayValues1 */
    </div>
    <div>
    /* oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, JDBCcon, arrayValues1); */
    </div>
    <div>
    oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, <b>vendorConn</b>, arrayValues1);
    </div>
    <div>
    callStatement = logicalCon.prepareCall( "? = call procName(?, ?, ?)");
    </div>
    <div>
    /* ..code to set the ?s ie array1 */
    </div>
    <div>
    callStatement.execute();
    </div>
    <div>
    }catch(Exceptio e){
    </div>
    <div>
    }</div>
    <div>
    finally </div>
    </div>{</div>
    <div>System.out.println(" I ve come to finally"); </div>
    <div>}</div>
    <div>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code snippet ends here ~~~~~~~~~~~~~~``
    </div>
    I have observed that the control immediately comes to the finally block after the call to the createDescriptor line above with <u>^%^%^%</u> in the comment. If i use the JDBCCon in this line...it works perfectly fine.
    Any pointers to where anything is getting wrong.
    I have jst set the vendorCon to null in the end of the file and not closed it. Subsequently i have closed the logicalCon. This has been mentioned in some of the thread in this forum also.
    Thanks,
    -jw

    Jatinder Wadhwa wrote:
    I 've gone through various threads relating to the topic of Oracle Arrays and the getVendorConnecton API call to avoid the class Cast Exception.. i ve used all these but am still facing the problem...
    I would appreciate it if some one could resolve the following queries :
    I am using Weblogic 8.1 SP5 with oracle 8i
    1. I read that the need to use the getVendorConnection API to make pl/sql proc calls with oracle arrays from the WL Server wont be required to avoid classCastException...
    I tried to use the connection from the WL connection pool ..but it didnot work....I used the getVendorConnection API ..which also doesnot seem to work..
    I got the Heurisitc Hazard exception...I used the Oracle 9i driver ie ojdbc14.jar ...after this the exception is not coming but still the code doesnt seem to work...
    the snippet of the code is pasted below :
    ~~~~~~~~~~~~~~~~~~~~~~~code is : ~~~~~~~~~~~~~~~~~~~Hi. Show me the whole exception and stacktrace if you do:
    try
    vendorConn = ((WLConnection)logicalCon).getVendorConnection();
    java.util.Map childMap1 = vendorConn.getTypeMap();
    childMap1.put("SST_ROUTE_ENTRY" Class.forName("svm.stport.ejb.StaticRouteEntry"));
    vendorConn.setTypeMap(childMap1);
    oracle.sql.ArrayDescriptor arrayDesc1 =
    oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR",
    vendorConn);
    oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, vendorConn, arrayValues1);
    callStatement = logicalCon.prepareCall( "? = call procName(? ? ?)");
    callStatement.execute();
    }catch(Exception e){
    e.printStackTrace();
    finally
    try{logicalCon.close();}catch(Exception ignore){}
    System.out.println(" I ve come to finally");
    /*below :
    logicalCon is the Connection from the WL connection pool
    JDBCcon is the JDBC connection. */
    <div> try </div>
    <div>{ </div>
    <div>
    <b>vendorConn</b> = ((WLConnection)logicalCon).getVendorConnection();
    </div>
    <div>
    //Calling the procedure
    </div>
    <div>
    //java.util.Map childMap1 = JDBCcon.getTypeMap();
    </div>
    <div>
    java.util.Map childMap1 = <b>vendorConn</b>.getTypeMap();
    </div>
    <div>
    childMap1.put("SST_ROUTE_ENTRY", Class.forName("svm.stport.ejb.StaticRouteEntry"));
    </div>
    <div>
    //JDBCcon.setTypeMap(childMap1);
    <b>vendorConn</b>.setTypeMap(childMap1);
    </div>
    <div>
    // Create an oracle.sql.ARRAY object to hold the values
    </div>
    <div>
    /*oracle.sql.ArrayDescriptor arrayDesc1 = oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", JDBCcon); */
    </div>
    <div>
    oracle.sql.ArrayDescriptor arrayDesc1 =
    oracle.sql.ArrayDescriptor.createDescriptor("SST_ROUTE_ENTRY_ARR", <b>vendorConn</b>); // here if i use the JDBCcon it works perfectly.... <u>^%^%^%</u>
    </div>
    <div>
    code to fill in the sst route entry array....
    .....arrayValues1 */
    </div>
    <div>
    /* oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, JDBCcon, arrayValues1); */
    </div>
    <div>
    oracle.sql.ARRAY array1 = new oracle.sql.ARRAY(arrayDesc1, <b>vendorConn</b>, arrayValues1);
    </div>
    <div>
    callStatement = logicalCon.prepareCall( "? = call procName(?, ?, ?)");
    </div>
    <div>
    /* ..code to set the ?s ie array1 */
    </div>
    <div>
    callStatement.execute();
    </div>
    <div>
    }catch(Exceptio e){
    </div>
    <div>
    }</div>
    <div>
    finally </div>
    </div>{</div>
    <div>System.out.println(" I ve come to finally"); </div>
    <div>}</div>
    <div>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code snippet ends here ~~~~~~~~~~~~~~``
    </div>
    I have observed that the control immediately comes to the finally block after the call to the createDescriptor line above with <u>^%^%^%</u> in the comment. If i use the JDBCCon in this line...it works perfectly fine.
    Any pointers to where anything is getting wrong.
    I have jst set the vendorCon to null in the end of the file and not closed it. Subsequently i have closed the logicalCon. This has been mentioned in some of the thread in this forum also.
    Thanks,
    -jw

  • View Criteria in ADF Query Panel with Table-Class Cast Exception

    Hi,
    I am getting Class Cast Exception when using view criteria for ADF Query Panel with Table. The version I am using is 11g Release 1(11.1.1.2.0)
    Here is what I did:
    1. created a view criteria on a view object
    2. all are optional
    3. all are Strings
    3. Dragged the view criteria as a query component (ADF Query panel with Query table) on to the design layout
    and the error when I clicked the Search button is:
    javax.el.ELException: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
    at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1289)
    at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sni.foundation.facesextensions.filters.FoundationFilter.doFilter(FoundationFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._clearFilterCriteriaRows(FacesCtrlSearchBinding.java:4549)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4603)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:423)
    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:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    Thanks
    Venkatesh

    Hi Frank.
    I'm using JDev 11.1.1.3.0 as you suggest the error is no longer present in the latest version.
    I can pick my query from the "Saved Search" pick list on the QueryPanel list of queries just fine, and it sets up the filter properly, but when I press the "Search" button, I get the same reported error...
    <RegistrationConfigurator><handleError> Server Exception during PPR, #1
    javax.el.ELException: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
         at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1303)
         at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._clearFilterCriteriaRows(FacesCtrlSearchBinding.java:4588)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4642)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:424)
         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:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         ... 42 more

  • Class cast exception using Finder method

    Hello. I'm new to J2EE. I have set up one entity bean but am having trouble
    with my current one.
    Basically, I have two finder methods:
    public ShareHistory findByPrimaryKey(Integer historyId)
            throws FinderException, RemoteException;
        public Collection findByShare(String shareId)
             throws FinderException, RemoteException; findByPrimaryKey works fine, but findByShare causes a class cast exception in java.lang.String.
    The stack trace in the server logs shows that it is my ejbActivate method in my entity bean causing the problem:
    public void ejbActivate() {
          //String numberString = (String) context.getPrimaryKey();
          //historyId = new Integer(numberString);
        historyId = (Integer) context.getPrimaryKey();
        }The stack trace from my client shows that the class cast exception occurs
    in the client at the System.out.println("shareid" + ": " + sh.getShareId());
    line:
    Collection c = sharesHistoryHome.findByShare("DCAN");
                     Iterator i = c.iterator();
                          while (i.hasNext()) {
                         ShareHistory sh = (ShareHistory) i.next();
                    System.out.println("shareid" + ": " + sh.getShareId());
                    System.out.println("value" + ": " + sh.getValue());
                     System.out.println("time" + ": " + sh.getTime());
                     System.out.println("date" + ": " + sh.getDate());
                     }//whileAs you can see I tried casting to a string in ejbactivate, but that simply causes an Integer class cast exception during findByprimaryKey instead. How do I allow both Integer and String objects to be used?
    Also I am a bit confused as to why the String passed to findByShare(String) is being used in context.getPrimaryKey() in the first place (if that is actually what's happening).

    Oops my FindByShare method was returning a collection of shareId's (strings) instead of a collection of Integer primary keys, which would explain the class cast exception.

  • Getting class cast exception in Web application.

    I have a web application deployed using standard specs for deployment. I
              have and web-inf directory with a web.xml file set up. All the servlet
              classes are in the classes sub-directory of web-inf.
              If I deploy this application using the Tomcat application server,
              everything works as expected. When I deploy this application using the
              Weblogic software, I can get to the initial page, put once I select a
              link that calls the main servlet, I get a classcast exception. Both the
              Tomcat and Weblogic software point to the same directory for the
              application.
              I double checked and made sure that no other instances of my servlet
              classes exist anywhere else in the class path.
              Any one have any thoughts or suggestions. I am perplexed that this web
              app runs fine under the Tomcat software and yet...
              Thanks.
              Paul Garduno
              

    Thanks for your reply. I am not using any EJBs. From what I have
              gathered since writing my message, this may be the "dreaded" class cast
              exception (although I don't know why since it runs under Tomcat).
              Basically, the initial page is displayed. When you select the SEARCH
              button (for example), the request goes to a servlet which puts a vector
              of custom classes into a session parameter. The request is then
              forwarded to the JSP page which uses the information in the classes to
              help build some information on the page. The first line in the JSP is
              processed (a simple output line to the system console) and then the
              classcast exception occurs.
              According to the info that I have seen, this shouldn't happen since I am
              not changing either the servlet or JSP files which would mean that
              nothing should be re-compiled.
              I have a call into tech support. I will post their answer and copy you
              on the message.
              Thanks.
              Paul
              Cameron Purdy wrote:
              >
              > Are you using EJBs hosted on the same instance of WebLogic? If so, delete
              > the home/remote interfaces from your web deployment. Otherwise, post the
              > exception listing ....
              >
              > Cameron Purdy, LiveWater
              >
              > "Paul Garduno" <[email protected]> wrote in message
              > news:[email protected]...
              > > I have a web application deployed using standard specs for deployment. I
              > > have and web-inf directory with a web.xml file set up. All the servlet
              > > classes are in the classes sub-directory of web-inf.
              > >
              > > If I deploy this application using the Tomcat application server,
              > > everything works as expected. When I deploy this application using the
              > > Weblogic software, I can get to the initial page, put once I select a
              > > link that calls the main servlet, I get a classcast exception. Both the
              > > Tomcat and Weblogic software point to the same directory for the
              > > application.
              > >
              > > I double checked and made sure that no other instances of my servlet
              > > classes exist anywhere else in the class path.
              > >
              > > Any one have any thoughts or suggestions. I am perplexed that this web
              > > app runs fine under the Tomcat software and yet...
              > >
              > > Thanks.
              > >
              > > Paul Garduno
              

  • Class cast exception in Process Control

    Hello,
    I am trying to use a SubProcess through a Process Control from a ParentProcess in another Workshop application.
    They are both deployed in the same domain.
    The SubProcess Control is packaged in a Control Project whose jar is imported in the other ParentProcess Workshop application.
    The data that is passed is in form of XML documents described as schemas. And both applications use the same Schema.jar.
    The call from the ParentProcess looks like it is OK.
    But when the reply comes back it looks like the transform fails. I get a "class cast exception"
    The feeling I get is that the returning xml document variable can't be cast into the local xml document variable. Even though they are of the exact same type...
    All help is very much appreciated!!!
    Unhandled Process Exception:
    java.lang.ClassCastException
    at se.telia.object.kund.control.sokKundPControl.clientRequest(Unknown Source)
    at se.telia.tab.regae.process.Untitled.sokKundPctrlClientRequest(Untitled.jpd:101)
    -------------

    I'm having some problems with a transformation and I'm getting a cast exception so maybe it's the same thing.
    The problem is when the source schema has some element with minOccurs="0". If the element is not present in the xml document that is received, the transformation seems to be trying to cast it anyway.

  • Class Cast exception in ArrayDescriptor.createDescriptor(

    I want to pass an array into a an Oracle procedure called using a callableSatement.
    When I create the array descriptor i get an class cast exception. I believe this error occurs when the sun.jdbc.odbc.JdbcOdbcConnection
    or the weblogic.jdbc.wrapper.PoolConnection_weblogic_jdbc_oci_Connection connection object is being cast to oracle.jdbc.driver.OracleConnection by createDescriptor method how can i overcome this run time error????

    Welcome to the forum!
    >
    am trying to pass ArrayList to Oracle procedure
    but when i am excuting the code i got the following error
    java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with oracle.jdbc.OracleConnection
    Can anybody help me to resolve this problem.
    >
    Not if you don't provide the code you are using so we can see what it is doing. Also post your 4 digit Oracle version, Java version, JDBC jar file name/version and the procedure signature that shows the language, parameters and types.
    An ArrayList is a Java object so are you using a Java stored procedure?
    Or are you using WebSphere? If WebSphere see this IBM link which appears to apply to the problem you are describing.
    http://www-01.ibm.com/support/docview.wss?uid=swg21409335

  • Class Cast Exception in weblogic 7

    Hello,
    When I am accessing remote method, I am getting the following class cast exception
    java.lang.ClassCastException: com.sbm.form.model.ProjectDataModel
    at com.sbm.form.ejb.ProjectBean_mexp15_EOImpl_WLStub.getProject(Unknown
    Source)
    at com.sbm.form.action.ProjectClient.getProject(ProjectClient.java:110)
    at com.sbm.form.action.ProjectProcessController.fetchProject(ProjectProc
    essController.java:49)
    at com.sbm.form.action.ProjectProcessController.processRequest(ProjectPr
    ocessController.java:33)
    at com.sbm.form.action.SbmFormAction.doProcess(SbmFormAction.java:21)
    at com.sbm.form.action.SbmAbstractServlet.doGet(SbmAbstractServlet.java:
    27)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:945)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:332)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:242)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:5363)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:721)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3043)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    Any idea
    Thanks,
    Kavitha.

    You should use prefer-application-packages when there is any conflict of classes specifically when the same class is being loaded by weblogic server.
    When your using prefer-application-packages you should always set prefer-web-inf-classes to false.
    This is documented please check following docs.
    http://docs.oracle.com/cd/E24329_01/web.1211/e21049/weblogic_xml.htm#autoId24
    http://docs.oracle.com/cd/E15051_01/wls/docs103/programming/classloading.html#wp1097263
    Regards,
    Sunil P

  • Class Cast Exception in JSP of the component

    Hi,
      I am trying to call a web service from the JSP of the component.I have written the java code as a scriplets in the JSP. The problem i am facing is Class Cast Exception. The code is as follows
    String strKey = "wsclients/proxies/sap.com/CCMSContentBroker/com.sap.ccmscontentbroker.CCMSContentProxy";
    java.lang.Object obj ;
    obj = context.lookup(strKey);
    str1 = obj.getClass().getName();
    ContentBroker objCB= null; 
    objCB = (ContentBroker)obj; // getting error here
    ContentBroker is an web service interface. The same code is working if i write it in the component but not in the scriplet of the JSP.
    Can't we do the type cast in the JSP ?
    Cant we call the web services in the JSP?
    How to eliminate this Class cast Exception in my code?
    Thanks and Regards,
    Saravanan

    Hi Harini,
             Thanks for your reply. I have checked all the import statements in the JSP.The problem is in the Type casting of object <b>obj</b> to ContentBroker variable <b>objCB</b>.
    Are u saying typr casting is not possible in JSP or organising imports in the JSP.
    These are my imports statements in the JSP
    <%@ page import = "java.util.ResourceBundle" %>
    <%@ page import = "com.sapportals.htmlb.*" %>
    <%@ page import = "com.intel.ccmt.ccmscontentbroker.* "%>
    <%@ page import = "com.intel.ccmt.ccmscontentbroker.types.* "%>
    <%@ page import = "com.sapportals.portal.prt.contentconversion.XSLConverter" %>
    <%@ page import = "com.sapportals.portal.prt.component.IPortalComponentRequest" %>
    <%@ page import="java.io.File" %>
    <%@ page import="javax.naming.Context" %>
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="javax.naming.NamingException" %>
    <%@ page import="java.util.StringTokenizer"%>
    Can u help me on rectifying this class cast Exception ?
    Thanks and Regards,
    Saravanan

  • Class Cast exception in JSP

    Hi All,
    Softwares used : UI--> JSP/Flex Grid/Dojo framwork
    Spring MVC
    Back end : EJB 3.0
    application Server : Jboss 4.2.2
    i have one Ajax call witch will update my flex grid after getting the data from Backend.
    i am able to get responce object but i am getting the class cast exception in the jsp.
    This ajax call used for upload the file.i have filter witch contains the wrap the request like
    (HttpServletRequest) Proxy.newProxyInstance(
                        (javax.servlet.http.HttpServletRequest.class).getClassLoader(),
                        getInterfacesForObject(request), new HttpServletRequestProxy(
                                  request, entries));
    exception given below
    19:54:04,372 ERROR [[ifx]] Servlet.service() for servlet ifx threw exception
    java.lang.ClassCastException: $Proxy333
         at org.apache.catalina.core.ApplicationDispatcher.unwrapRequest(ApplicationDispatcher.java:776)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
         at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:240)
         at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:258)
         at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1174)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    Can you help me out for resolve this issue.
    Regards,
    Ritesh Kumar K.

    riteshkumar wrote:
    but we are using copying and pasting the application related lib's in the jboss\lib folder along with default jboss lib'sI am not sure if I understand you.
    any way i tried but it's not resolving my problem.No other causes comes to mind. Sorry, can't help you further. Good luck with solving.

  • Type problem - Class Cast Exception - trying to understand

    hello,
    i get a Class cast exception in the following code.
    interface Foo {}
    class Alpha implements Foo {}
    class Beta extends Alpha {}
    class Delta extends Beta {
    public static void main( String[] args ) {
    Beta x = new Beta();
    Beta b = (Beta)(Alpha)x; //fine
    Foo f = (Delta)x; //CCE
    Object ob = new Object();
    String s = new String();
    ob = s; //fine, no need of case
    s = (String)ob; //needs a castI was just thinking, implicitly Delta and Beta both of them IS-A Foo, and assigning x to a type foo shouldnt be a problem(while making it refer to the Delta class) so, what could cause the CCE ?
    I would appreciate if someone could please help me understand this.
    Rgds

    Hi.
    Assigning your "x" to a variable typed Foo is not a problem. The problem is that you are trying to cast an instance of Beta ("x") into type Delta which is not possible. Every Delta is a Beta, but not every Beta will be a Delta!
    Simple as that.
    Bye.

  • WL 10 Upgrade Class Cast Exception

    Hi, we are upgrading from WL 8.1 to 10.3 and are recieving the following exception when invoking the test of our web service. Any ideas?
    ...Ed
    java.lang.ClassCastException: weblogic.xml.saaj.DetailImpl cannot be cast to weblogic.xml.xmlnode.XMLNode
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">
    java.lang.ClassCastException: weblogic.xml.saaj.DetailImpl cannot be cast to weblogic.xml.xmlnode.XMLNode
         at weblogic.webservice.core.soap.SOAPElementImpl.addChildElement(SOAPElementImpl.java:136)
         at weblogic.webservice.core.soap.SOAPFaultImpl.setDetail(SOAPFaultImpl.java:52)
         at weblogic.webservice.util.FaultUtil.fillFault(FaultUtil.java:129)
         at weblogic.webservice.util.FaultUtil.exception2Fault(FaultUtil.java:190)
         at weblogic.webservice.core.handler.InvokeHandler.serializeFault(InvokeHandler.java:203)
         at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:159)
         at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:144)
         at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:551)
         at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204)
         at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:175)
         at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:97)
         at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:101)
         at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:321)
         at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:453)
         at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:292)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    </bea_fault:stacktrace>

    "Andrew Gilbert" <[email protected]> writes:
    What protocol are you using? If t3 you might want to try explicitly
    turning off iiop to prevent it loading its own PRO classes.
    -Dweblogic.system.enableIIOP=false
    andy
    Having a problem while trying to upgrade from WL 5.1/Tomcat 3.3 to WL 7.01
    and Tomcat 4.1.12. Using JDK 1.3.1 on Win2K. Interop between Tomcat and WL
    is always more an adventure than it should be! Here are the specifics:
    Placed weblogic.jar into "shared" classloader in Tomcat distribution. This
    sits above the Web Application class loaders. Placed our code, including EJB
    Home and Remote classes into Web-Inf/lib. There are two web applications.
    WebApp "A" successfully finds Home and works fine, until at some point we
    try to reference the same Home from within the other WebApp "B". At that
    point we get a class cast exception.
    java.lang.ClassCastException
    at
    com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemo
    teObject.java:296)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at COM.soundbite.ejb.EJBHomes.getAccountHome(EJBHomes.java:444)
    at COM.soundbite.ejb.EJBHomes.forAccount(EJBHomes.java:163)
    The Home class in the web app is loaded by a WEB-INF level class loader and
    the chain looks clean. The Home implementation stub gets loaded by
    weblogic.utils.classloaders.GenericClassLoader, whose parent appears to be a
    WEB-INF level class loader. This chain also looks clean.
    Any ideas?

  • Exception: Cannot narrow remote object to ...

    Hi,
              in certain circumstances I get an Exception "Cannot narrow remote
              object to <some EJB-Home-Class>".
              My enviroment: weblogic 7.0, solaris, Java 1.3.1, J2EE-application
              (EJBs, Servlets, Database)
              In the init method of an start-up servlet I spawn some threads for a
              scheduler of the application. There are a scheduler core and some
              worker classes.
              The start-up servlet, all the other servlets and the schedulers
              classes are in an web-archive (war-file) in an ear-archiv. Furthermore
              there a some 3rd party archives in the ear-archive, a jndi.properties
              file etc. The manifest file of the war-archive contains a class-path,
              points to the 3rd party archives in the ear-archive.
              The schedulers workers code is simple:
              InitialContext jndiContext = ...getInitialContext();
              Object obj = jndiContext.lookup(<some EJB>);
              - EJBs home interface (for example):
              SyncOrderQueueHome home = (SyncOrderQueueHome)
              javax.rmi.PortableRemoteObject.narrow(obj,
              SyncOrderQueueHome.class);
              - EJBs remote interface:SyncOrderQueue sync = home.create();
              - call some business method
              sync.createOrderQueue();
              In the enviroment described above I get an " Exception: Cannot narrow
              remote object to <package>.SyncOrderQueueHome".
              On the other hand the scheduler and all the workers work fine as a
              standalone application (not in an app-server context) and in Oracles
              app-server (OC4J, v.9.0.3).
              I tried to understand, what for an object I get as the result of the
              JNDI lookup bevore the narrow method fails:
              - in the app-servers context:
              <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl
              - outside the app-server:
              <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl_WLStub
              What happened here? The common servlets use the same functionality and
              work fine. Why I get different objects? Where is the bug?
              Any ideas?
              Thomas
              

    I believe the problem is the threads you are starting are not using the
              context classloader of the current thread.
              -- Rob
              [email protected] wrote:
              > Hi,
              >
              > in certain circumstances I get an Exception "Cannot narrow remote
              > object to <some EJB-Home-Class>".
              >
              > My enviroment: weblogic 7.0, solaris, Java 1.3.1, J2EE-application
              > (EJBs, Servlets, Database)
              >
              > In the init method of an start-up servlet I spawn some threads for a
              > scheduler of the application. There are a scheduler core and some
              > worker classes.
              > The start-up servlet, all the other servlets and the schedulers
              > classes are in an web-archive (war-file) in an ear-archiv. Furthermore
              > there a some 3rd party archives in the ear-archive, a jndi.properties
              > file etc. The manifest file of the war-archive contains a class-path,
              > points to the 3rd party archives in the ear-archive.
              >
              > The schedulers workers code is simple:
              >
              > InitialContext jndiContext = ...getInitialContext();
              > Object obj = jndiContext.lookup(<some EJB>);
              >
              > - EJBs home interface (for example):
              > SyncOrderQueueHome home = (SyncOrderQueueHome)
              > javax.rmi.PortableRemoteObject.narrow(obj,
              > SyncOrderQueueHome.class);
              >
              > - EJBs remote interface:SyncOrderQueue sync = home.create();
              >
              > - call some business method
              > sync.createOrderQueue();
              > In the enviroment described above I get an " Exception: Cannot narrow
              > remote object to <package>.SyncOrderQueueHome".
              >
              > On the other hand the scheduler and all the workers work fine as a
              > standalone application (not in an app-server context) and in Oracles
              > app-server (OC4J, v.9.0.3).
              >
              > I tried to understand, what for an object I get as the result of the
              > JNDI lookup bevore the narrow method fails:
              > - in the app-servers context:
              > <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl
              > - outside the app-server:
              > <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl_WLStub
              >
              > What happened here? The common servlets use the same functionality and
              > work fine. Why I get different objects? Where is the bug?
              >
              > Any ideas?
              > Thomas
              

Maybe you are looking for

  • Replaced 680 with T5 & can't hotsync

    There must be an article about this, but I can't find it.  I used to have a Palm M515 then got a Treo 680. I lost it so I now have a Tungsten T5.  I used the CD that came with the Tungsten, and kept the same user name. Now I cannot get the calendar a

  • Transfer of Business Partner Master data from CRM to TIBCO.

    Hi All, We intend to integrate CRM4.0 with TIBCO for transfer of Business Partner Master data from CRM to TIBCO. Can anyone provide solution for the same. One of the think is through XI.Please correct if it is the right way to do it?. Also, would app

  • Export in HD 1280x720 16:9 without letterbox

    I use a Canon HG20 and want to fit YouTube's widescreen with no letterbox but I can't seem to export in HD without a letterbox. A tutorial video said to use these settings Key frames - Every 30 frames Data rate - Restrict to 1800 kbits/sec Dimensions

  • Is there an Oracle-recommended tool to customize eBS standard reports?

    Hi, a few days ago a collegue of mine dropped in and asked for a tool to customize eBusinessSuite (R12) standard reports. He came along with XXBA_PO_STANDARD_XSLFO.xsl (which is a mix of XSL and FO) and asked me if I could modify the position of some

  • I'm stuck in proxy mode, how can I get out?

    I seem to be be stuck in proxy mode. Even with a new library and a new clip, it shows a 'missing proxy' label. I can't switch to 'optimized/original media'. FCPX simply doesn't do it. I already tried trashing prefs and reinstalling FCPX. please help?