Java.lang.ClassCastException in Servle while using EJB

I m trying to get a ejb instant in a servlet.I am using Blazix EJB server as a EJB contianer and Blazix Web server as servlet container.I get a java.lang.ClassCastException.
I m using Demo bean with DemoHome as home interface and DemoBean as EJB name.
The servlet code contains....
Context initial = getInitialContext();
Object objref = initial.lookup("DemoBean");
DemoHome dhome =(DemoHome)PortableRemoteObject.narrow(objref,DemoHome.class);
               demo = dhome.create();
The printStackTrace is as follows
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 BeanServlet.init(BeanServlet.java:30)
at desisoft.server.servlets.Servlet.init(Servlet.java:52)
at desisoft.server.servlets.Context.getServletInstance(Context.java:1783
at desisoft.server.servlets.Context.getContextInternalDispatcher(Context.java:2583)
at desisoft.server.servlets.Context.getContextDispatcher(Context.java:2402)
at desisoft.server.servlets.Context.getDispatcher(Context.java:2212)
at desisoft.server.common.HttpStream.processRequest(HttpStream.java:617)
at desisoft.server.conn.ServerThread.run(ServerThread.java:335)
So please help me
Regards
Pravin

I am having a similar issue with stratightforward client code ...
I set properties values
java.naming.provider.url=iiop://officepc:3700
java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
java.naming.factory.url.pkgs=com.sun.enterprise.naming
in a properties file.
When "Object objref = jndiContext.lookup( resourceId ) "
returns,objref is resolved as a "com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1"
instance. The "resourceId" is a String jndi-name for a Session Bean reference.
When the "javax.rmi.PortableRemoteObject.narrow((java.lang.Object) objref, CartHome.class )"
is called, the stack dumps:
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
Any thoughts? I have tried everything, I think.
HW

Similar Messages

  • Java.lang.ClassCastException in FOTable while inserting fo:table-row

    Hi
    Template Builder of in word was throwing error 'java.lang.ClassCastException:oracle.apps.xdo.template.fo.elements.table.FOTable'.This error comes whenever i introduce <fo:table-row> tag.
    I am using XML Desktop Pubisher 5.5 Build Version
    Please help me out.
    Thanks
    Darshan

    Sorry for the trouble . I have found out the solution
    So this thread can be closed.
    Thanks
    Darshan

  • 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.

  • Facing java.lang.ClassCastException: DummyPagePhaseListener cannot be cast to oracle.adf.model.RegionController while am using master detail relationship by af:table

    Hi friends,
         We are in to new development in Oracle ADF and newbie to this technology.
         Created .jsf page and in corresponding pagedef, has "ControllerClass" with refering "DummyPagePhaseListener" and we have master-detail relationship using Viewlink(created using a SQL Query and  entity based view).
        Below exception raised when navigating from one  to another record in Master af:table. Any help will be appreciated. Thanks in Advance......
    java.lang.ClassCastException: DummyPagePhaseListener cannot be cast to oracle.adf.model.RegionController
    at oracle.adf.model.binding.DCBindingContainer.getRegionController(DCBindingContainer.java:5197)
    at oracle.adf.model.binding.DCBindingContainer.validate(DCBindingContainer.java:4247)
    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.validateModelUpdates(PageLifecycleImpl.java:300)
    at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.validateModelUpdates(FacesPageLifecycle.java:70)
    at oracle.adf.controller.v2.lifecycle.Lifecycle$6.execute(Lifecycle.java:202)
    at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:197)
    at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$600(ADFPhaseListener.java:23)
    at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$3.after(ADFPhaseListener.java:323)
    at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:75)
    at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:447)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
    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:173)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    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.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    Hi timo,
    Thanks for ur reply...
    we are using unbounded taskflow.
    In Controller class(page def file), we refered the class that implements PagePhaseListener
    The following override methods has created
      public void afterPhase(PagePhaseEvent pagePhaseEvent) {
    //In this area we used to read the session object file which is written and sent by another application(application to application navigate).
    If session object file exists,will allow the user to navigate into the requested page else will navigate in to login(security aspect).
      public void beforePhase(PagePhaseEvent pagePhaseEvent) {
    Is we used Controller class wrongly ???
    Is there any relationship with region controller???
    Mani
    [email protected]

  • Java.lang.ClassCastException while creating array descriptor

    ( This post was moved from SQL / PLSQL forum to here )
    Hi everyone, i used to pass string array from java to plsql. I wrote a java source, then i load db with loadjava. And i wrote java spec. Then i run the function but i am getting this error :
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    My Java Source is :
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.*;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    public class SplitterOracle3 {
    public static oracle.sql.ARRAY tokens2(String str,String delim)
    try
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //Connection conn = new OracleDriver().defaultConnection( );
    OracleDriver ora = new OracleDriver();
    OracleConnection conn = (OracleConnection) ora.defaultConnection();
    //ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("MY_ARRAY", ((conn).getRealConnection());
    //Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    //Connection conn = ((DelegatingConnection) getDataSource().getConnection()).getInnermostDelegate();
    // get an initial context
    //OracleConnection oracleConnection = (OracleConnection)WSJdbcUtil.getNativeConnection((WSJdbcConnection) wsConn);
    ArrayDescriptor arraydesc =
    ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);
    String strarr[] = new String[47];
    strarr[0]="ahmet";
    strarr[1]="mehmet";
    int curIndex = 0;
    int nextIndex = 0;
    boolean nextIsLastToken = false;
    int i=0;
    while (true)
    nextIndex = str.indexOf(delim, curIndex);
    if (nextIsLastToken)
    //return false;
    break;
    if (nextIndex == -1)
    nextIsLastToken=true;
    nextIndex = str.length();
    strarr[i] = str.substring(curIndex, nextIndex);
    curIndex = nextIndex + 1;
    i++;
    ARRAY dirArray = new ARRAY(arraydesc, conn, strarr);
    return dirArray;*/
    catch(Exception ex)
    System.err.println(ex.getMessage());
    ex.printStackTrace();
    return null;
    public static void main(String[] args)
    String str="2000,2,123553168,1,10,64895,65535,27662,64860,64895,65535,27662,64860,0,,,,,,0,0,2491039806,,,,,,,,,0,0,1,,2491039106,,,,,,,,,,,,";
    String strarr[] = new String[47];
    long l1,l2;
    int j=0;
    l1 = System.currentTimeMillis();
    for ( int i=0; i<20000000; i++)
    strarr = tokens2(str,",");
    l2 = System.currentTimeMillis();
    System.out.println("Fark :"+ (l2-l1));
    The line has "ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);" causes this error.
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    But i could not find the solution. Can you help me?
    Thanks for responses.

    Hi,
    Did you try my suggestion from Re: java.lang.ClassCastException while create array descriptor
    Try replacing
    oracle.jdbc.driver.OracleConnectionwith
    oracle.jdbc.OracleConnectionRegards
    Peter

  • Java.lang.ClassCastException: examples.ejb.basic.statefulSession.TraderBeanHomeImpl_ServiceStub

    I am using the example from the XML/HTTP which uses a client, servlet and request
    handler. The Servlet calls the StatefulSession TraderHome Bean.
    I am getting the following: java.lang.ClassCastException: examples.ejb.basic.statefulSession.TraderBeanHomeImpl_ServiceStub.
    Anyboy have a similar problem?
    This works with the Client prg in the ejb/basic/StatefulSssion "Client" It works
    correctly

    I am using the example from the XML/HTTP which uses a client, servlet and request
    handler. The Servlet calls the StatefulSession TraderHome Bean.
    I am getting the following: java.lang.ClassCastException: examples.ejb.basic.statefulSession.TraderBeanHomeImpl_ServiceStub.
    Anyboy have a similar problem?
    This works with the Client prg in the ejb/basic/StatefulSssion "Client" It works
    correctly

  • Java.lang.ClassCastException serializing EJB

    Hi!
    I'm getting this exception while passing an EJB as a method parameter.
    RMI Exception passing by to client
    java.lang.ClassCastException: com.evermind.server.rmi.RemoteInvocationHandler
    at com.evermind.server.ejb.EJBOutputStream.replaceEJBObject(EJBOutputStream.java:53)
    at com.evermind.server.ejb.EJBOutputStream.replaceObject(EJBOutputStream.java:25)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:318)
    The Remote interface extends java.io.Serializable, and the Bean Class implement this interface (obviously). All fields in the Bean implementation class are also Serializable.
    I don't know why casting to com.evermind.server.rmi.RemoteInvocationHandler fails for this EJB, and I don't know if is the expected behavior.
    Any ideas?
    F.Catrin
    TUXPAN

    Hi!
    I'm getting this exception while passing an EJB as a method parameter.
    RMI Exception passing by to client
    java.lang.ClassCastException: com.evermind.server.rmi.RemoteInvocationHandler
    at com.evermind.server.ejb.EJBOutputStream.replaceEJBObject(EJBOutputStream.java:53)
    at com.evermind.server.ejb.EJBOutputStream.replaceObject(EJBOutputStream.java:25)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:318)
    The Remote interface extends java.io.Serializable, and the Bean Class implement this interface (obviously). All fields in the Bean implementation class are also Serializable.
    I don't know why casting to com.evermind.server.rmi.RemoteInvocationHandler fails for this EJB, and I don't know if is the expected behavior.
    Any ideas?
    F.Catrin
    TUXPAN

  • Java.lang.ClassCastException in EJB's

    Friends Need your suggestions on the following:-
    1. try {
    2.     InitialContext ctx = new InitialContext();
    3.     Object objref = ctx.lookup("ejb/test/MyTestSessionBean");
    4.     testSessionBean = (MyTestSessionHome) PortableRemoteObject.narrow(
    5.               objref, MyTestSessionHome.class);
    6. } catch (Exception NamingException) {
    7.      NamingException.printStackTrace();
    8. }
    I am unable to understand as to why I am getting an exception at line 4.
    The exception is:-
    11:21:56,649 ERROR [STDERR] java.lang.ClassCastException
    11:21:56,649 ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:
    293)
    11:21:56,649 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    11:21:56,649 ERROR [STDERR] at test.session.SessionTestServlet.init(SessionTestServlet.java:29)
    11:21:56,649 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
    11:21:56,649 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
    11:21:56,649 ERROR [STDERR] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
    11:21:56,649 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
    The above exception comes as soon as I deploy my ear to deploy folder in JBOSS.
    Thanks,
    Vishal

    I was facing the same proble. Simply diasble packaging class files in war file and the problem will be solved. Check build xml...I have commecnted class file addition in war file......Hope it solve your problem....I am beginer in Java technology...so dont hope expert repy from me in case your problem is still not solved....
    <?xml version="1.0"?>
    <!-- ==================================================== -->
    <!-- Build file for our first web application -->
    <!-- build.xml, Saturday, July 20, 2002 -->
    <!-- Author: Deepak Kumar -->
    <!-- Email : [email protected] -->
    <!-- Url : http://www.roseindia.net -->
    <!-- ==================================================== -->
    <project name="Jboss 3.0 tutorial series" default="all" basedir=".">
         <path id="build.classpath">
              <fileset dir="D:/JBOSS-4.0.4/server/default/lib/">
                   <include name="*.jar"/>
              </fileset>
         </path>
         <target name="init">
              <property name="dirs.base" value="${basedir}"/>
              <property name="classdir" value="${dirs.base}/build/src"/>
              <property name="src" value="${dirs.base}/src"/>
              <property name="web" value="${dirs.base}/web"/>
              <property name="deploymentdescription" value="${dirs.base}/deploymentdescriptors"/>
              <property name="warFile" value="example3.war"/>
              <property name="earFile" value="example3.ear"/>
              <property name="jarFile" value="example3.jar"/>
              <property name="earDir" value="${dirs.base}/build/ear"/>
              <property name="warDir" value="${dirs.base}/build/war"/>
              <property name="jarDir" value="${dirs.base}/build/jar"/>
              <!-- Create Web-inf and classes directories -->
              <mkdir dir="${warDir}/WEB-INF"/>
              <mkdir dir="${warDir}/WEB-INF/classes"/>
              <!-- Create Meta-inf and classes directories -->
              <mkdir dir="${earDir}/META-INF"/>
              <mkdir dir="${jarDir}/META-INF"/>
         </target>
         <!-- Main target -->
         <target name="all" depends="init,build,buildWar,buildJar,buildEar"/>
         <!-- Compile Java Files and store in /build/src directory -->
         <target name="build" >
              <javac srcdir="${src}" destdir="${classdir}" classpathref="build.classpath" debug="on" includes="**/*.java" />
         </target>
         <!-- Create the web archive File -->
         <target name="buildWar" depends="init">
    <!--          <copy todir="${warDir}/WEB-INF/classes">
                   <fileset dir="${classdir}" includes="**/*.class" />
              </copy>
    -->     
              <copy todir="${warDir}/WEB-INF">
                   <fileset dir="${deploymentdescription}/web/" includes="web.xml,jboss-web.xml" />
              </copy>
              <copy todir="${warDir}">
                   <fileset dir="${web}" includes="**/*.*" />
              </copy>
              <!-- Create war file and place in ear directory -->
              <jar jarfile="${earDir}/${warFile}" basedir="${warDir}" />
         </target>
         <!-- Create the jar File -->
         <target name="buildJar" depends="init">
              <copy todir="${jarDir}">
                   <fileset dir="${classdir}" includes="**/*.class" />
              </copy>
              <copy todir="${jarDir}/META-INF">
                   <fileset dir="${deploymentdescription}/jar/" includes="ejb-jar.xml,jboss.xml" />
              </copy>
              <!-- Create jar file and place in ear directory -->
              <jar jarfile="${earDir}/${jarFile}" basedir="${jarDir}" />
         </target>
         <!-- Create the ear File -->
         <target name="buildEar" depends="init">
              <copy todir="${earDir}/META-INF">
                   <fileset dir="${deploymentdescription}/ear" includes="application.xml" />
              </copy>
              <!-- Create ear file and place in ear directory -->
              <jar jarfile="${basedir}/${earFile}" basedir="${earDir}" />
         </target>
    </project>

  • Sun J2EE SDK 1.3_01, java.lang.ClassCastException thrown during deployment

    I encountered a bug while using the deploytool to deploy
    an EAR file to the Sun J2EE 1.3_01 server.
    I submitted a bug report to Sun via the Sun Java Developer Connection.
    (Sorry, it has not been assigned a BugID yet)
    Question:
    Does anybody know if the web container in Sun's
    J2EE 1.3_01 server supports access to local enterprise beans?
    Screenshots of the bug are available at
    http://sync4j.sourceforge.net/deploymentbug/
    Full details below....
    -Sean
    category: j2ee
    subcategory: deployment
    release: 1.3_01
    hardware: x86
    OSversion: windows_2000
    synopsis: java.lang.ClassCastException thrown during deployment of Session bean
    java -version
    java version "1.3.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
    Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
    C:\j2sdkee1.3\bin>j2ee -version
    Java 2 Enterprise Edition version 1.3_01, build 1.3_01-b01
    I built a EJB 2.0 compliant stateful session bean.
    The session bean has a remote interface (ISyncRemote),
    a remote home interface (ISyncHomeRemote),
    a local interface (ISyncLocal),
    and a local home interface (ISyncHomeLocal).
    I built an HTTP Servlet that is supposed to access
    the Stateful Session Bean using ISyncHomeLocal and
    ISyncLocal
    I run "deploytool.bat" in GUI mode to perform the deployment.
    During deployment, the deploytool GUI displays a message
    box which states:
    "There was a deployment error.
    java.rmi.ServerException: RemoteException occurred in server thread;
    nested exception is:
    java.rmi.RemoteException: An error was encountered while loading
    a web component.
    Please refer to
    <J2EE_HOME>/logs/<machine-name>/j2ee//j2ee/error.log
    for more information. Please verify your Application with the
    Verifier tool."
    The "error.log" file did not contain any useful information.
    I ran the J2EE "verifier.bat" tool to verify that my EAR archive is OK.
    The Sun J2EE server output this error string:
    "java.lang.ClassCastException:
    com.sun.enterprise.deployment.EjbExternalDescriptor"
    Here is the full output from the Sun J2EE server:
    C:\j2sdkee1.3\bin>j2ee -verbose
    J2EE server listen port: 1050
    Naming service started:1050
    Binding DataSource, name = jdbc/EstoreDB, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/Cloudscape, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/DB1, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/DB2, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/InventoryDB, url =
    jdbc:cloudscape:rmi:CloudscapeDB;create=true
    Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
    Binding DataSource, name = jdbc/XACloudscape__xa, dataSource =
    COM.cloudscape.core.RemoteXaDataSourc
    e@245536
    Starting JMS service...
    Initialization complete - waiting for client requests
    Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
    Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
    Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
    Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
    >
    Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
    Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
    >
    Starting web service at port: 8000
    Starting secure web service at port: 7000
    J2EE SDK/1.3
    Starting web service at port: 9191
    J2EE SDK/1.3
    J2EE server startup complete.
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_LocalHomeImpl.java ....
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_EJBLocalObjectImpl.java ....
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_RemoteHomeImpl.java ....
    Compiling c:\j2sdkee1.3\repository\rbi\gnrtrTMP\Sync4j Server enterprise
    application\sync4j\server\s
    yncbean\SyncBean_EJBObjectImpl.java ....
    rmic sync4j.server.syncbean.SyncBean_RemoteHomeImpl...
    rmic sync4j.server.syncbean.SyncBean_EJBObjectImpl...
    c:\j2sdkee1.3\repository\rbi\applications\Sync4j Server enterprise
    application1004172068449Server.ja
    r
    Binding name:`java:comp/env/ejb/ISyncHomeRemote`
    Binding name:`java:comp/env/ejb/ISyncHomeLocal`
    java.lang.ClassCastException:
    com.sun.enterprise.deployment.EjbExternalDescriptor
    at com.sun.enterprise.deployment.EjbReferenceDescriptor.getValue
    (EjbReferenceDescriptor.java
    :202)
    at com.sun.enterprise.naming.NamingManagerImpl.bindObjects
    (NamingManagerImpl.java:394)
    at com.sun.web.server.WebService.addContext(WebService.java:148)
    at com.sun.web.server.ServletDeployerImpl.loadWebComponents
    (ServletDeployerImpl.java:214)
    at
    com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployWebComponent
    s
    (JarInsta
    llerImpl.java:791)
    at
    com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployApplication
    (JarInstall
    erImpl.java:219)
    at
    org.omg.stub.com.sun.enterprise.tools.deployment.backend._JarInstallerImpl_Tie.
    invoke(Un
    known Source)
    at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch
    (ServerDelegate.java:355)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process
    (RequestProcessor.java:84)
    at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run
    (ThreadPool.java:99)
    Does the Sun J2EE server implementation support the invocation
    of Session EJB's via a Local interface?
    Does the Sun J2EE server implementation allow a Servlet to invoke
    Session EJB's via the bean's Local interface?
    While researching this issue, I read the J2EE 1.3 final specification.
    The spec says:
    "The EJB container is required to access to local enterprise beans.
    We recommend that the web container also support access to local
    enterprise beans."
    Does the web container in Sun's J2EE server support access to local enterprise beans?

    I'm pretty much sure that you cannot access a
    local Session bean from outside the EJB container.Please read the J2EE 1.3 specification before posting messages about EJB and J2EE.
    According to the J2EE 1.3 specification:
    "The EJB container is required to support access to local enterprise beans. We recommend that the web container also support access to local enterprise beans.
    No support is provided for access to local enterprise beans from the application client container or the applet container."
    If you use local interfaces for your session bean,
    than your client must be local too. A local client is
    a client that is collocated in the same JVM with the
    session/entity that provides the local view and which
    can be tightly coupled to the bean.My client is running in the same JVM as my EJB. The client is a servlet. The servlet is running in the same JVM as the EJB.
    For what its worth, the error that I observed occurs during deployment. I haven't figured out why deployment is failing.

  • Java.lang.ClassCastException  in local lookups

    hi,
    i have written two ejb projects named as proj1 and proj2.
    i deployed proj1 as EAR1 and proj2 as EAR2.(in same server)
    in proj1 Sessionbean1  i need to use(lookup) proj2 Sessionbean2 .
    <b>i have given jndi name for proj2 Sessionbean2 as "jndiproj2"</b>
    InitialContext ic=new InitialContext();
    Sessionbean2LocalHome home=(Sessionbean2LocalHome)ic.lookup("localejbs/jndiproj2");
    while i am running this application i am getting java.lang.ClassCastException.
    (this application is working fine if i deployed both proj1 and proj2 together as single EAR)
    regards
    Guru

    Have you ever connected to your SAP J2EE Engine using the Visual Administrator?  If so, you can go to Server->Service->JNDI Registry and look under the localejbs for the actual name that would work in the lookup method.
    It appears to me that you are missing the vendor.  If you have not specified a vendor in the application-j2ee-engine.xml, then it is by default "sap.com", then your ejb application name, then you EJB name.
    I have created a bean SurveyReportsBean with my SurveyApp with the vendor of pcbp.com.  My lookup would be:
    "localejbs/pcbp.com/SurveyApp/SurveyReportsBean"
    Hope this helps.

  • Java.lang.ClassCastException

    My class CDRack is almost ready, but in the last method
    sortAlphabetically() there
    comes java.lang.ClassCastException. I found in the net
    http://java.sun.com/docs/books/tutorial/collections/algorithms/
    that with method Collections.sort(l) I can sort alphabetically.
    The code compiles, but when I run it with a tester program, it stops
    to ClassCastException in the almost last row.
    Something is wrong with Collections.sort(l) ?
    /** Class CDRack represents collections of compact discs. Discs are
    located in the rack in slots numbered from zero upwards. The discs are
    represented by Record objects and empty slots by null values. */
    public class CDRack extends Object {
      private Record[] mRecords;
      private int size;
    /**Creates a new, empty CD rack.
    Parameters:
    size - the size of the new rack, i.e. the number of slots it has */
          public CDRack(int size) {
              mRecords = new Record[size];
              this.size = size;
    /** "Organizes" the discs in the rack so that they will be located in
    consecutive slots starting at slot number zero, and any and all empty
    slots will be at the "end of the rack". After calling this method, the
    discs are in an undefined (i.e. arbitrary) order - the only thing this
    method guarantees is that there aren't any empty slots in between full
    ones.
          public void organize() {
              // Turn array into a list - more flexible
              List l = Arrays.asList(aanilevyt);
              // Remove all nulls from a copy of the list which supports  removal.
              l = new ArrayList(l);
              while (l.remove(null)) /*do nothing*/;
              // Clear the original array.
              for (int i = 0; i < mRecords.length; i++){
                   mRecords[i] = null;
              } // Put the non-nulls back.
              l.toArray(mRecords);
    /**"Organizes" the discs in the rack to the beginning of the rack (see
    the method organize) and sorts them in alphabetical order. Recordings
    by the same artist are placed in alphabetical order by disc name. */
        public void sortAlphabetically() {
              // Turn array into a list - more flexible
              List l = Arrays.asList(aanilevyt);
              // Remove all nulls from a copy of the list which supports  removal.
              l = new ArrayList(l);
              while (l.remove(null)) /*do nothing*/;
              // Clear the original array.
              for (int i = 0; i < mRecords.length; i++){
                   mRecords[i] = null;
              } // Put the non-nulls back.
              l.toArray(mRecords);
              Collections.sort(l);   // alphabetical order. THERE IS CLASSCASTEXCEPTION 
    }

    I have thought and thought but the sorting alphabetically doesnt work.
    I can't use Collections.sort and class Record doesnt implement Comparable(and I can't change it).
    One suggestion was that I could make my own class which implements Comparator. Could it be like this
    import java.util.*;
    public class AlphabeticComparator
    implements Comparator{
      public int compare(Object o1, Object o2) {
        String s1 = (String)o1;
        String s2 = (String)o2;
        return s1.toLowerCase().compareTo(
          s2.toLowerCase());
    }      But how an earth can I tell to CDRack class that it would
    use the class AlphabeticComparator?
    Somebody please save my Christmas!
    /** Class CDRack represents collections of compact discs. Discs are
    located in the rack in slots numbered from zero upwards. The discs are
    represented by Record objects and empty slots by null values. */
    public class CDRack extends Object {
      private Record[] mRecords;
      private int size;
    /**Creates a new, empty CD rack.
    Parameters:
    size - the size of the new rack, i.e. the number of slots it has */
          public CDRack(int size) {
              mRecords = new Record[size];
              this.size = size;
    /** "Organizes" the discs in the rack so that they will be located in
    consecutive slots starting at slot number zero, and any and all empty
    slots will be at the "end of the rack". After calling this method, the
    discs are in an undefined (i.e. arbitrary) order - the only thing this
    method guarantees is that there aren't any empty slots in between full
    ones.
          public void organize() {
              // Turn array into a list - more flexible
              List l = Arrays.asList(aanilevyt);
              // Remove all nulls from a copy of the list which supports  removal.
              l = new ArrayList(l);
              while (l.remove(null)) /*do nothing*/;
              // Clear the original array.
              for (int i = 0; i < mRecords.length; i++){
                   mRecords<i> = null;
              } // Put the non-nulls back.
              l.toArray(mRecords);
    /**"Organizes" the discs in the rack to the beginning of the rack (see
    the method organize) and sorts them in alphabetical order. Recordings
    by the same artist are placed in alphabetical order by disc name. */
        public void sortAlphabetically() {

  • Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection

    Hi All,
    I am getting below exception when I am trying to establish HTTPS connection using
    Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
    sometime my code works and some time it gives me this exception
    below is the exception which i traced in a log file
    2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfundstest.com/fsu/router
    2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION Created HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
    2008/09/11 01:07:57->1_1210001776_0:entered into else Block
    2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0Error URLC Not a instance of HTTPS Connection: HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
    2008/09/11 01:07:57->1_1210001776_0:Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
    In the success case when my HTTPS connection gets established I am getting following in the log file.
    2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfunds.com/fsu/router
    2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION Created com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection:https://netfunds.com/fsu/router
    Here is the code which I am using
    I am importing following packages in my code
    import java.security.*;
    import java.security.cert.*;
    //import javax.net.ssl.*;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    import javax.net.ssl.HandshakeCompletedListener;
    import javax.net.ssl.HandshakeCompletedEvent;
    import javax.net.ssl.SSLSession;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    //import javax.security.cert.*;
    import com.sun.net.ssl.*;
    //import org.apache.xalan.*;
    //import org.apache.xerces.*;
    import org.apache.xerces.dom.*;
    import org.apache.xml.serialize.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import oracle.xml.classgen.*;
    try
    System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
    System.setProperty("https.proxyHost",geProxy);
    System.setProperty("https.proxyPort",geProxyPort);
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    int n=0;
    while(n<3)
    debugMsg(instCount+"URL CONNECTION CALLED " + fsuFrontEndURL);
    url = new URL(fsuFrontEndURL);
    /* Changed to include Tunnel code */
    urlc = url.openConnection();
    debugMsg(instCount+"URL CONNECTION Created " + urlc);
    if (urlc instanceof com.sun.net.ssl.HttpsURLConnection)
    debugMsg("entered into If Block");
    debugMsg("Value of n:" + n);
    ((com.sun.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
    ((com.sun.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
    debugMsg("after If Block");
    break;
    else {
    try{
    debugMsg("entered into else Block");
    ((javax.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
    ((javax.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
    debugMsg("after else Block");
    break;
    catch(Exception e) {
    debugMsg(instCount+"Error URLC Not a instance of HTTPS Connection: " + urlc);
    debugMsg("Exception: " + e);
    I am using JDK 1.5 and Apache/1.3.19
    Can anyone help me out ....?

    for URL'S Starting with HTTPS only.....Sometimes it works and sometimes it gives me the classcast exception
    As soon as I bounces my Apache application server...then it starts working...I dont know why its happening like that..
    Is there any issue with the Ports I am trying to connect or some Apache configuration files settings are getting changed ?

  • Getting java.lang.ClassCastException

    Hi All,
    I am getting below exception when I am trying to establish HTTPS connection using
    Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
    sometime my code works and some time it gives me this exception
    below is the exception which i traced in a log file
    2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfundstest.com/fsu/router
    2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION Created HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
    2008/09/11 01:07:57->1_1210001776_0:entered into else Block
    2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0Error URLC Not a instance of HTTPS Connection: HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
    2008/09/11 01:07:57->1_1210001776_0:Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
    In the success case when my HTTPS connection gets established I am getting following in the log file.
    2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfunds.com/fsu/router
    2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION Created com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection:https://netfunds.com/fsu/router
    Here is the code which I am using
    I am importing following packages in my code
    import java.security.*;
    import java.security.cert.*;
    //import javax.net.ssl.*;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    import javax.net.ssl.HandshakeCompletedListener;
    import javax.net.ssl.HandshakeCompletedEvent;
    import javax.net.ssl.SSLSession;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    //import javax.security.cert.*;
    import com.sun.net.ssl.*;
    //import org.apache.xalan.*;
    //import org.apache.xerces.*;
    import org.apache.xerces.dom.*;
    import org.apache.xml.serialize.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import oracle.xml.classgen.*;
    try
    System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
    System.setProperty("https.proxyHost",geProxy);
    System.setProperty("https.proxyPort",geProxyPort);
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    int n=0;
    while(n<3)
    debugMsg(instCount+"URL CONNECTION CALLED " + fsuFrontEndURL);
    url = new URL(fsuFrontEndURL);
    /* Changed to include Tunnel code */
    urlc = url.openConnection();
    debugMsg(instCount+"URL CONNECTION Created " + urlc);
    if (urlc instanceof com.sun.net.ssl.HttpsURLConnection)
    debugMsg("entered into If Block");
    debugMsg("Value of n:" + n);
    ((com.sun.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
    ((com.sun.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
    debugMsg("after If Block");
    break;
    else {
    try{
    debugMsg("entered into else Block");
    ((javax.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
    ((javax.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
    debugMsg("after else Block");
    break;
    catch(Exception e) {
    debugMsg(instCount+"Error URLC Not a instance of HTTPS Connection: " + urlc);
    debugMsg("Exception: " + e);
    I am using JDK 1.5 and Apache/1.3.19
    Can anyone help me out ....?

    Hi ejp,
    thanks for ur response
    I did what ever u suggested ...but after compiling the code I am getting following errors
    cannot find symbol
    symbol : class X509TrustManager
    location: class EPCardXMLExchange
    class MyX509TrustManager implements X509TrustManager {
    ^
    EPCardXMLExchange.java:594: cannot find symbol
    symbol : class HostnameVerifier
    location: class EPCardXMLExchange
    class MyHostnameVerifier implements HostnameVerifier {
    ^
    EPCardXMLExchange.java:413: cannot find symbol
    symbol : class X509TrustManager
    location: class EPCardXMLExchange
    X509TrustManager tm = new MyX509TrustManager();
    ^
    EPCardXMLExchange.java:414: cannot find symbol
    symbol : class HostnameVerifier
    location: class EPCardXMLExchange
    HostnameVerifier hm = new MyHostnameVerifier();
    ^
    EPCardXMLExchange.java:429: cannot find symbol
    symbol : class KeyManagerFactory
    location: class EPCardXMLExchange
    KeyManagerFactory kmf;
    ^
    EPCardXMLExchange.java:430: cannot find symbol
    symbol : variable KeyManagerFactory
    location: class EPCardXMLExchange
    kmf = KeyManagerFactory.getInstance("SunX509");
    ^
    EPCardXMLExchange.java:440: cannot find symbol
    symbol : class TrustManager
    location: class EPCardXMLExchange
    TrustManager []tma = {tm};
    ^
    EPCardXMLExchange.java:441: cannot find symbol
    symbol : class SSLContext
    location: class EPCardXMLExchange
    SSLContext sc = SSLContext.getInstance("SSL");
    ^
    EPCardXMLExchange.java:441: cannot find symbol
    symbol : variable SSLContext
    location: class EPCardXMLExchange
    SSLContext sc = SSLContext.getInstance("SSL");
    ^
    EPCardXMLExchange.java:444: cannot find symbol
    symbol : variable HttpsURLConnection
    location: class EPCardXMLExchange
    HttpsURLConnection.setDefaultSSLSocketFactory(sf1);
    ^
    EPCardXMLExchange.java:445: cannot find symbol
    symbol : variable HttpsURLConnection
    location: class EPCardXMLExchange
    HttpsURLConnection.setDefaultHostnameVerifier(hm);
    ^
    EPCardXMLExchange.java:643: cannot find symbol
    symbol : class X509TrustManager
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    X509TrustManager tm = new MyX509TrustManager();
    ^
    EPCardXMLExchange.java:644: cannot find symbol
    symbol : class HostnameVerifier
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    HostnameVerifier hm = new MyHostnameVerifier();
    ^
    EPCardXMLExchange.java:658: cannot find symbol
    symbol : class KeyManagerFactory
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    KeyManagerFactory kmf;
    ^
    EPCardXMLExchange.java:659: cannot find symbol
    symbol : variable KeyManagerFactory
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    kmf = KeyManagerFactory.getInstance("SunX509");
    ^
    EPCardXMLExchange.java:669: cannot find symbol
    symbol : class TrustManager
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    TrustManager []tma = {tm};
    ^
    EPCardXMLExchange.java:670: cannot find symbol
    symbol : class SSLContext
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    SSLContext sc = SSLContext.getInstance("SSL");
    ^
    EPCardXMLExchange.java:670: cannot find symbol
    symbol : variable SSLContext
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    SSLContext sc = SSLContext.getInstance("SSL");
    ^
    EPCardXMLExchange.java:675: cannot find symbol
    symbol : variable HttpsURLConnection
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    HttpsURLConnection.setDefaultSSLSocketFactory(dfactory);
    ^
    EPCardXMLExchange.java:676: cannot find symbol
    symbol : variable HttpsURLConnection
    location: class EPCardXMLExchange.SSLTunnelSocketFactory
    HttpsURLConnection.setDefaultHostnameVerifier(hm);
    ^
    20 errors
    Can you tell me what I am getting errors ?

  • Java.lang.ClassCastException when trying to retrive a jdbc/OracleDS

    Hello friends, I'm experiencing a rare problem, "java.lang.ClassCastException" when trying to retrive the jdbc/OracleDS datasource using JNDI lookup, the exception is there, either, when running in the embebed OC4J from JDev 10.1.3.3 or when deploying (the War) to my OracleIAS (10.1.2). Actualy we are programing the DataSource and changing the URL each time we update the application (in both environment: Developer and Production), it is just a temporary "work around" while we find the real solution.
    We can't Cast a Oracle Object (oracle.jdbc.pool.OracleDataSource) to the java DataSource. Why?
    Here you have the story:
    The application wa started in Eclipse 3.2 with Tomcat 5, and we are using Struts 1.1 and Hibernate 3, in this environment we don't have problems. the problem happens during deploying the application to our Orace AS 10g (10.1.2). When googling for solution we found related problems in some forums, so we tried all the solutions explained in that post, including this. Finaly, we failed to find the solution.
    After that, we migrate the application to JDeveloper 10.1.3.3, and then try the JNDI lookup and the problem STAY, then we did everything again into JDev:
    - Changed the default jdk from 1.5 to 1.4.2_06, for the projects, the embebed OC4J and the Java Compiler....
    - Configuring the DataSource manualy in the xml.
    - Testing with several jdk version, trying on embebed oc4j, standalone oc4j, Oracle IAS, and so on.
    - We have tried everything we found in the posts.
    But .... the problem still :'(.
    We have found that some guys have solved the problems with the change of the jdk and other small stuff, but all that were not enough for us.
    Have somebody found other solution for this problem or we have some alien problem here?.
    Thanks in advance.

    Fer Domin, thanks by your replay.
    The answer for your question is, YES. We have tried with several DataSource types in the Oracle side (app server,embebed oc4j, standalone oc4j) and the app side (java). Also, all jdbc datasource extend the javax.sql.DataSource .. so it's rare to have this error when doing a simple jndi lookup.
    We tried deploying a small app (from Oracle) to test the DataSource in the app server (10.1.2.0.2) and it was working well. But we don't know which jdk was used to package that ear/war (I mean the TestDS small app).
    So, everything look like we are having a jdk compatibility problem ... but we don't know which it's or where it's.... because we configure JDeveloper 10.1.3.3 to use the same jdk, even for compiling and running the embebed oc4j and the problem still.
    Thanks again.

  • Error processing WSDL document: java.lang.ClassCastException: java.util.Ar

    Hi
    Program is giving unpredictable behaviour.
    Am trying to consume webservice using Axis Client.
    When running as stand alone Java programs its working fine.
    But when deployed on OC4J its giving problem
    Error processing WSDL document: java.lang.ClassCastException: java.util.ArrayList
    Could you please give some hint
    Regards
    Bajarang

    Here is the program
    QName serviceQN = new QName(targetNamespace,serviceName );
    System.out.println("After serviceQN "+ serviceQN);
    QName portQN = new QName( targetNamespace, portName );
    System.out.println("After port "+ portQN);
    // This Call object will be used the invocation
    Service service = new Service(implURI,serviceQN);
    System.out.println("After service "+ service);
    Call call = (Call) service.createCall();
    System.out.println("After call "+ call);
    // Now make the call...
    System.out.println("Invoking service>> " + serviceName + " <<...");
    call.setOperation(portQN,operationName);
    call.invoke( inputParams );
    System.out.println("Result returned from call to "+ serviceName+" ");
    Error while execution
    javax.xml.rpc.ServiceException: Error processing WSDL document:
    java.lang.ClassCastException: java.util.ArrayList

Maybe you are looking for

  • FaceTime has a slash and not working!!!

    Please can someone help me! My FaceTime on my MacBook Air is not working. I have installed updates and supplement updates and it is still not working! The little camera icon has a slash across it! This is so frustrating!!! Thank you

  • When i buy iTUNES SONGS i GET ERROR MESSAGE!!

    When i purchased some music in itune store i keep getting message! (There were problems downloading some purchased items check for available downloads from the store menu) when i do this i keep getting same message wassup?????????????????

  • How can HANA Server Side JavaScript use "Eval" function?

    Hi HANA Experts,   I use EVAL function to create an object by classname in xsjs file, but it has an Error "Eval is evil". In Client javascript, we can use the Eval function. How can we use "EVAL" function in HANA server side javaScript?  Thanks a lot

  • Error when installing java se sdk  6.16

    Hi All, while installing java se 6.16 sdk I get this error: " Installer: Wrapper.WriteFile(In small chunks) failed with error 112: there is not enough space on the disk." I can not figure this out as my hard drive has 207Gb free. any help apreciated.

  • How do I import a folder of images without creating a new project?

    In Aperture 2.xxx I can import a folder of photos into the project and mimic the folder structure on my hard drive. For example, I export photos as tiffs into a folder that is a subfolder of the folder that contains the master raw files on my hard dr