ClassCastException using Dataobjects

Hello,
at first, I am not sure if I am in the right forum.
We have developed an application which is using a Stateless SessionBean for getting data (countries) out of the database (using eclipselink).
On filling a list of select items we are getting a ClassCastException although the classes are identical (same package, same class name)
My first Taskflow just checks some conditions and if everything is right it calles Tasklow A or Taskflow B.
Taskflow A now shows some screens and on one screen, the controller (my managed bean) reads the countries out of the database using the Stateless SessionBean.
The interface of this SessionBean method is java.util.List<ICountry) bean.getListOfCountries().
The managed bean now tries to convert this list of Country objects into a list of SelectItems for displaying a selectOneChoice component.
List<SelectItem> countries = new ArrayList<SelectItem>();
List<ICountry> listOfCountries = statelessSessionBean.getListOfCountries();
for (int i=0;i<listOfCountries.size();i++) {
ICountry country = listOfCountries.get(i); <----- the ClassCastException occurs
SelectItem item = new SelectItem();
item.setLabel(country.getIsoCode());
item.setValue(country.getIsoCode());
item.setDescription(resourceBundle.getString("country." + country.getIsoCode()));
countries.add(item);
The data is read from the database and passed to the managed bean correctly. I have a List of ICountry objects in my managed bean.
When I now try to cast one of these objects to the Interface ICountry, the system throws a ClassCastException my.data.ICountry cannot be cast to my.data.ICountry
As far as I found out, the classes are loaded by different classloaders.
GenericClassLoader
ChangeAwareClassLoader
I have no idea, how to change the project settings to overcome this problem.
My Application is divided into several projects
Application: TestApp (ear)
Project: TestApp (contains a single JSF with a region for the outer Taskflow) (war)
Controller1 (contains the outer Taskflow) (ADF Shared Library)
Controller2 (contains the inner Taskflows which does the work) (ADF Shared Library)
DataObjects(contains my interfaces and data objects ICountry, Country) (jar)
SB_Environment (contains the stateless session bean) (ejb-jar)
Can anyone give me a hint?
Environment: Standard JDeveloper 11.1.1.4.0
Regards
Edmund

This release notes for XSQL Servlet 1.0.1 contain the following NOTE:
At this time, the <xsql:insert-param> and <xsql:insert-request> action elements depend on the Oracle JDBC Driver because they depend on the Oracle XML SQL Utility for Java which at present exhibits this restriction. A future release of Oracle XML SQL will remove this current restriction.
The same holds for the <xsql:update-request> and <xsql:delete-request>. The underlying problem is with the XML SQL Utility which currently works fine with any driver for reading data, but fails to insert, update, or delete with drivers other than Oracle. This restriction has already been fixed in-house and will be available as part of the next release of the XML SQL Utility put onto OTN. If the XSQL Servlet is used with that upcoming fixed version of the xsu12.jar for the XML SQL Utility, you will no longer hit this problem.

Similar Messages

  • ClassCastException using Subant and wldeploy ant task

    Hi!
    I'm using subant to call all diffrent build.xml files located in subdirectories. The buildfile looks like this:
    <project name="extern.call" default="callall">
         <target name="callall">
              <fileset      id="buildfile.set" dir=".." includes="*2/build.xml">
                   <exclude name="Br*2/*"/>
              </fileset>
              <subant target="deploy-local" inheritall ="false" failonerror="true">
                   <fileset      refid="buildfile.set"/>
              </subant>
         </target>
    </project>
    The first called build.xml files works fine ... but the execution of the second build.xml (it's not important which file is the second one, it's crash always at the second call), stop with a "java.lang.ClassCastException".
    See Stacktrace:
    [subant] weblogic.Deployer -debug -nowait -verbose -upload -noexit -name ClarifyRead -source \build\ClarifyRead\delivery\ClarifyRead.ear -targets myserver -adminurl t3://localhost:7001 -user weblogic -password ******** -deploy
    [subant] dumping Exception stack
    [subant] java.lang.ClassCastException
    [subant] at weblogic.management.deploy.utils.DeployerHelper.uploadSource(DeployerHelper.java:586)
    [subant] at weblogic.Deployer.runBodyWithAuthenticatedSubject(Deployer.java:824)
    [subant] at weblogic.Deployer.runBody(Deployer.java:711)
    [subant] at weblogic.utils.compiler.Tool.run(Tool.java:146)
    [subant] at weblogic.utils.compiler.Tool.run(Tool.java:103)
    [subant] at weblogic.Deployer.runMain(Deployer.java:566)
    [subant] at weblogic.Deployer.mainWithExceptions(Deployer.java:576)
    [subant] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [subant] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [subant] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [subant] at java.lang.reflect.Method.invoke(Method.java:324)
    [subant] at weblogic.ant.taskdefs.management.WLDeploy.invokeMain(WLDeploy.java:264)
    [subant] at weblogic.ant.taskdefs.management.WLDeploy.execute(WLDeploy.java:204)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:65)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:340)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:65)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:340)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.Target.execute(Target.java:301)
    [subant] at org.apache.tools.ant.Target.performTasks(Target.java:328)
    [subant] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
    [subant] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
    [subant] at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:182)
    [subant] at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:112)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.Target.execute(Target.java:301)
    [subant] at org.apache.tools.ant.Target.performTasks(Target.java:328)
    [subant] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
    [subant] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:379)
    [subant] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
    There is no diffrent between using ant in eclipse environment or as standalone, the result it the same.
    Do someone else have the same problem?
    Kind regards
    Joseph

    Hi
    I got the same message and I couldn't resolve it too, I am wordering if you got the key to the problem?
    Thanks
    Daivd Huang

  • ClassCastException using EJB from a service

    Hi all,
    I developed a DeployService and currently I'm getting a ClassCastException while accessing the a EJB.
    I put the lookup within a delegate which is also be used from a webDynpro application. With the WebDynpro App everything work properly, but if I call the delegate from the service a SAPClassCastException I thrown, when I cast the object to the home interface.
    The coding is as follows:
                   Properties props = new Properties();
                   props.put(Context.PROVIDER_URL,"localhost:50004");
                   props.put(Context.INITIAL_CONTEXT_FACTORY,
                   "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   context = new InitialContext(props);
                   Object obj = context.lookup(jndiName);
                   EJBHome ejb = EJBHomeFactory.getInstance().lookup(jndiName, ComponentHome.class);
                   ComponentHome componentHome = (ComponentHome)ejb;
    Thanks a lot for the help.
    Falk

    Hi Falk,
    Hey just tell me that what is the EJBHome and ComponentHome and EJBHomeFactory in your coding.....
    You can try the following code for the same.
    Object obj =(Object) jndicontext.lookup("<Your JNDI name>");
    TestEJBHome home = (TestEJBHome) javax.rmi.PortableRemoteObject.narrow(
                   obj,
                   TestEJBHome.class);
    TestEJB hello = home.create();
    Here, TestEJBHome is your Home interface of the EJB and TestEJB is your remote interface. Now you can use hello object to call your business methods of EJB.
    Regards,
    Bhavik

  • ClassCastException using PJC in Forms 9.0.4.1.0

    I'm trying to setup a simple PJC in a Forms using Oracle Forms 9.0.4.1.0 but I get a FRM-92100 with a java.lang.ClassCastException: nl.eurotransplant.pjc
    I've create a Form with a simple Java bean and set the implementation class to "nl.eurotransplant.pjc"
    I've also created the class nl.eurotransplant.pjc implementing the IView interface. I've implemented all the abstract methods from IView but none of them are doing anything (yet) other the system.out.println to the console.
    Packaged the nl.eurotransplant.pjc in a JAR file and included that in the archive parameter for Forms.
    From the console I can see the constructor of the PJC is being called and the init method is being called and completes. No more messages after that.
    Does anyone of you have a suggestion as to what I'm doing wrong?

    I searched some more on the Forum and eventually found a whitepaper on PJC's in Forms 6i. That gave me the tip not to implement the IView interface, but just extend the VBean class.
    That's what I just tried and no more classCastException. That seems to fix my issue. No to develop the bean itself...

  • ClassCastException using bpelx:append

    When attempting to model sample 126 Data Aggregator I receive a ClassCastException. The snippet of bpel code I'm using looks like this:
    <assign name="Assign_1">
    <copy>
              <from expression="string('one')"/>
              <to variable="outputVariable"
              part="payload"
              query="/ns1:users/ns1:user"/>
    </copy>
         <bpelx:append>
              <bpelx:from expression="string('two')"/>
              <bpelx:to variable="outputVariable"
              part="payload"
              query="/ns1:users/ns1:user"/>
         </bpelx:append>
    I've tried variations of the query to include "/ns1:users" and also one with no query element. They all result in the exception.
    element user is unbounded within users. It's definition looks like:
    <xsd:element name="users"
         type="iC.MMIS.WS.tst:usersType"/>
    <xsd:complexType name="usersType">
         <xsd:sequence>
         <xsd:element name="user"
              type="iC.MMIS.WS.tst:userCnType"
              minOccurs="0"
              maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="userCnType">
         <xsd:restriction base="xsd:string">
         </xsd:restriction>
    </xsd:simpleType>
    Exception follows:
    05/08/14 21:36:53 java.lang.ClassCastException
    05/08/14 21:36:53      at com.collaxa.cube.xml.dom.DOMUtil.addNodes(DOMUtil.java:1598)
    05/08/14 21:36:53      at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.performAddNodes(BPELAssignWMP.java:840)
    05/08/14 21:36:53      at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.__executeStatements(BPELAssignWMP.java:191)
    05/08/14 21:36:53      at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:179)
    05/08/14 21:36:53      at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3398)
    05/08/14 21:36:53      at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1905)
    05/08/14 21:36:53      at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
    05/08/14 21:36:53      at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:100)
    05/08/14 21:36:53      at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:185)
    05/08/14 21:36:53      at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5412)
    05/08/14 21:36:53      at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1300)
    05/08/14 21:36:53      at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:117)
    05/08/14 21:36:53      at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvoke(CubeEngineBean.java:146)
    05/08/14 21:36:53      at ICubeEngineLocalBean_StatelessSessionBeanWrapper0.syncCreateAndInvoke(ICubeEngineLocalBean_StatelessSessionBeanWrapper0.java:486)
    05/08/14 21:36:53      at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequestAnyType(DeliveryHandler.java:493)
    05/08/14 21:36:53      at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequest(DeliveryHandler.java:426)
    05/08/14 21:36:53      at com.collaxa.cube.engine.delivery.DeliveryHandler.request(DeliveryHandler.java:133)
    05/08/14 21:36:53      at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:93)
    05/08/14 21:36:53      at IDeliveryBean_StatelessSessionBeanWrapper22.request(IDeliveryBean_StatelessSessionBeanWrapper22.java:288)
    05/08/14 21:36:53      at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:101)
    05/08/14 21:36:53      at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:65)
    05/08/14 21:36:53      at ngDoInitiate.jspService(_ngDoInitiate.java:253)
    05/08/14 21:36:53      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    05/08/14 21:36:53      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)
    05/08/14 21:36:53      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    05/08/14 21:36:53      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    05/08/14 21:36:53      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121)
    05/08/14 21:36:53      at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:267)
    05/08/14 21:36:53      at displayProcess.jspService(_displayProcess.java:660)
    05/08/14 21:36:53      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    05/08/14 21:36:53      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)
    05/08/14 21:36:53      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    05/08/14 21:36:53      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    05/08/14 21:36:53      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
    05/08/14 21:36:53      at com.collaxa.cube.fe.DomainFilter.doFilter(DomainFilter.java:152)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
    05/08/14 21:36:53      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    05/08/14 21:36:53      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:798)
    05/08/14 21:36:53      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:278)
    05/08/14 21:36:53      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)
    05/08/14 21:36:53      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    05/08/14 21:36:53      at java.lang.Thread.run(Thread.java:534)
    <2005-08-14 21:36:53,575> <ERROR> <default.collaxa.cube.xml> java.lang.ClassCastException

    That is a corner case that we did not handle properly.
    We did not automatically convert a String object into XML text node for users. That triggers that ClassCastException. We shall add that automatic conversion logic into our code. (We have opened a bug - bug # 4554032 - to track this problem down.)
    On the other hand, based on the supplied schema, your sample code may not perform your desired logic, if my guess is correct.
    Instead of:
    <assign name="Assign_1">
    <copy>
    <from expression="string('one')"/>
    <to variable="outputVariable"
    part="payload"
    query="/ns1:users/ns1:user"/>
    </copy>
    <bpelx:append>
    <bpelx:from expression="string('two')"/>
    <bpelx:to variable="outputVariable"
    part="payload"
    query="/ns1:users/ns1:user"/>
    </bpelx:append>
    Try:
    <assign>
    <bpelx:append>
    <bpelx:from expression
    = "ora:genEmptyElem('ns1:user',2)" />
    <bpelx:to variable="outputVariable" part="payload" query="/ns1:users" />
    </bpelx:append>
    <copy>
    <from expression=" 'one' " />
    <to variable="outputVariable" part="payload"
    query="/tns:users/tns:user[1]" />
    </copy>
    <copy>
    <from expression=" 'two' " />
    <to variable="outputVariable" part="payload"
    query="/tns:users/tns:user[2]" />
    </copy>
    </assign>
    If you want to know about the "genEmptyElem()" xpath function,
    please check it out
    http://localhost:9700/BPELConsole/default/domain.jsp?mode=xpath
    I hope I have answered your question.
    Regards,
    Alex Yiu

  • ClassCastException using Update Batching

    Oracle 9.2.0.4/Linux, JDBC driver 9.2.0.5
    I'm trying to use update batching but always get a
    ClassCastException when doing:
    ((oracle.jdbc.driver.OraclePreparedStatement) pstmt).setExecuteBatch(10);
    I've followed chapter 12 of the "Oracle9i JDBC Developer's Guide and Reference", but cannot get rid of this damn exception.
    Can anyone give me any clue about what's happening?
    BTW, JDBC standard batch works perfectly, I just wanted
    to test oracle specific batch vs standard batch.
    Thanks in advance.

    Avi,
    I forgot to say is that the code is
    inside an EJB, running under JBoss. I've tested
    it in JBoss 3.2.5, 3.2.6 and 3.2.7 with no success.
    I did not post any code because it's exactly the same
    that serves as an example in http://www.oracle.com/technology/products/oracle9i/daily/jun07.html
    except for the question that the imports are
    oracle.jdbc.driver.*, not oracle.driver.*.
                        java.sql.Connection connection = null;
                   java.sql.PreparedStatement pstmt = null;
    try {
                                  connection = DAOUtils.getDBConnection(JNDIConstants.DATASOURCE);
    // disable autocommit
    connection.setAutoCommit(false);
    String query =
    "INSERT INTO TABLE (ID, DATO)" +
    " VALUES (TABLE_SEQ.NextVal, ?)";
    pstmt = connection.prepareStatement(query);
    log.debug(pstmt.getClass().getName()); // org.jboss.resource.adapter.jdbc.WrappedPreparedStatement
    // set batch size
    ((OraclePreparedStatement) pstmt).setExecuteBatch(10); // ClassCastException
                                  pstmt.setInt(1, object.getId());
                                  pstmt.executeUpdate();
                                  ((OraclePreparedStatement) pstmt).sendBatch();
                                  connection.commit();
                        } catch (SQLException sqlex) {
                                  connection.rollback();
    sqlex.printStackTrace();
    throw new CustomException(CustomException.DB_ERROR, sqlex);
    } finally {
    DAOUtils.closePreparedStatement(pstmt);
    DAOUtils.closeConnection(connection);
    I'm going to post it also in JBoss forums.
    I'll keep on trying.

  • Why do I get a ClassCastException using JNDI between ears?

    This is an issue that has bothered me for almost a year. It comes up every once in a while and usually I can find a workaround, but I need to understand what is causing the failure.
    Here is the problem description as an abstract example:
    I have two WAR files deployed on WL (8.1 sp3), WarA and WarB.
    In a servlet in WarA, I execute the following:
      Context context = new InitialContext();
      MyObject myObj = new MyObject();
      context.bind("myObject", myObj);Then, in a servlet in WarB, I execute the following, receiving a ClassCaseException on the last line of code:
      Context context = new InitialContext();
      Object obj = context.lookup("myObject");
      MyObject myObj = (MyObject)obj;  //ClassCastException!!Of course I have deployed MyObject.class in a jar file inside the WEB-INF/lib of each WAR.
    I understand that each WAR file uses a seperate ClassLoader, but I do not understand why the object's class is not recognized when it is retrieved. I have tried several debugging methods (obj.getClass().getName() or halting execution using a debugger and looking at the object's class signature). In every instance the classname looks correct, exactly as I would expect it to, but the ClassCastException is thrown anyways.
    In the past I have "copped out" by creating an EAR, putting both WARs in the EAR, and adding the jar containing MyObject to the APP-INF/lib.
    Unfortunately the most recent occurrence of this problem is more complex and I do not have the luxury of my standard workaround. Can someone please fill in the blanks of what elementary concept I am overlooking?
    Thanks
    JB

    I don't think the classloader-structure tag is exactly what I am looking for. Based on the documentation I reviewed on the edocs site, that solution appears to make sense if you are manipulating numerous classloaders within a specific ear.
    I suppose you could try to use the classloader-structure to reference a classloader from a seperate application, but the docs do not indicate that this is a possibility. Moreover, it seems dangerous and potentially very confusing.
    Ultimately, I think this boils down to a lesson for me about classloaders. Unless someone can tell me otherwise, I am ready to concede that you cannot access/cast an object that you have bound to the JNDI tree in one application from within any other application. The notable exception to this rule is the scenario where the class type to which you are casting is a class that is loaded by the system classloader.
    This makes some sense to me - each standalone war or ear is independent of other wars/ears deployed on the app server. But, it is also somewhat frustrating because you cannot share global services across a suite of applications via JNDI unless you bundle them all as a single ear.

  • ClassCastException using HttpsURLConnection with Tomcat 4.1.27

    Hi,
    I try to open an SSL connection using HttpsURLConnection that works fine with a standalone application (see code fragment):
    import javax.net.ssl.HttpsURLConnection;
    import java.net.*;
    import java.io.*;
    URL website = new URL( "https://aSampleSSLSite" );
    HttpsURLConnection connection = ( HttpsURLConnection ) website.openConnection();
    Using the same code in Tomcat 4.1.27 and Struts 1.1 throws a java.lang.ClassCastException while trying to use website.openConnection().
    What is the difference?

    Hi,
    I'm using JDK 1.4.2 and haven't installed JSSE separately at all. Actually I really use javax.net.ssl.HttpsURLConnection. However, I tried com.sun.net.ssl.HttpsURLConnection as well and got a 'java.net.SocketException: Default SSL context init failed' instead of.
    Oddly enough the code works fine in a standalone application.

  • ClassCastException using DestinationService from an EJB

    Good morning,
    I am running NetWeaver 2004S SP5, and am attempting to make a call to the destination service from within a message-driven bean's onMessage() method.  I can access JNDI and obtain the object returned by doing a JNDI lookup on DestinationService.JNDI_KEY, but when I cast that value to the DestinationService class, I get a ClassCastException.
    I have a similar command-line client test program that makes the same call.  It can connect to the destination service and query the named HTTP destination  just fine.
    The code I'm using is:
    --- begin code snippet ---
    DestinationService dstService;
    try {
         InitialContext jndiCtx = new InitialContext();
         dstService = (DestinationService)jndiCtx.lookup(DestinationService.JNDI_KEY);
         HTTPDestination dest =
    (HTTPDestination)dstService.getDestination("HTTP", "OMSCBUrl");
         urlString = dest.getUrl();
         _logger.logInfo("Retrieved URL(" + urlString + ") from the OMSCB HTTP Destination OMSCBUrl");
    } catch (RemoteException re) {
         _logger.logInfo("Unable to contact the destination service : " + re);
    } catch (NamingException ne) {
         _logger.logInfo("Unable to contact the JNDI service : " + ne);
    } catch (DestinationException de) {
         _logger.logInfo("Unable to obtain the OMSCB HTTP Destination " + OMSCB_DESTINATION_NAME + " : " + de);
    --- end code snippet ---
    When I first got the ClassCastException, I had assumed it was from the line where I get the destination and cast it to an HTTPDestination.  It turns out, though, that I was wrong, and the cast error actually happens in casting the DestinationService.
    This class is in an EJB DC project, and I have checked my DC dependencies to make sure that I'm including the com.sap.exception, security.class, and tc/sec/destinations/interface DCs as Used DCs.  I have also verified that the corresponding EAR project has those three libraries included as references in the application-j2ee-engine.xml.  Before I had set those references, I was getting an error on deployment, but now the class deploys just fine.
    I did notice (both through looking at the JNDI registry in Visual Administrator and by examining the class of the object returned by the JNDI lookup) that the object returned by the JNDI lookup is a proxy object for a P4 binding stub.  I guess that's an RMI-accessible object?  I was wondering if I was missing a reference to the class that contains the binding stub.
    The JNDI values for the tcsecdestinations~service object are:
    [Class Name]: $Proxy111
    [Object Value]: RMI_P4:Dynamic Stub:com.sap.security.core.server.destinations.service.DestinationServiceImpl@3b6dbd
    Anyway, I'm stumped.  Any help would be greatly appreciated.
    Thanks,
    - Bill

    Hi Vinoth,
    Thanks for the reply.  Unfortunately, I've already looked at it, and it did not solve my problem.  I had gotten the sample code from there, but it didn't help with the runtime ClassCastException.
    However, I was able to resolve the problem.  It turns out that, in additon to the three library references in the application-j2ee-engine.xml, you need to add a reference to the tcsecdestinations~service service.  Once you add that and redeploy, the ClassCastException goes away.
    I believe that the problem was caused by JNDI returning a proxy object to an unresolvable class.
    Hope that helps someone else,
    - Bill

  • ClassCastException using ConvertDateTime

    I am getting the following exception when i am trying to run a page with convertdatetime tag.
    16:15:20,491 ERROR [Engine] ----- Root Cause -----
    java.lang.ClassCastException
         at javax.faces.webapp.ConverterTag.doStartTag(ConverterTag.java:111)
         at com.sun.faces.taglib.jsf_core.ConvertDateTimeTag.doStartTag(ConvertDateTimeTag.java:129)
         at org.apache.jsp.test_jsp._jspx_meth_f_convertDateTime_0(test_jsp.java:198)
         at org.apache.jsp.test_jsp._jspx_meth_h_form_0(test_jsp.java:155)
         at org.apache.jsp.test_jsp._jspx_meth_f_view_0(test_jsp.java:124)
         at org.apache.jsp.test_jsp._jspService(test_jsp.java:92)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    My code looks like:
         <f:view>
         <h:form id="frm" rendered="true">
              <h:inputText id="name" size="20" value="01/01/2005"/>
              <f:convertDateTime type="date" dateStyle="short"/>
              </h:inputText>
              <h:message for="name" /><br>
              <h:commandButton id="submit" action="Submit" value="Submit" />
         </h:form>
         </f:view>
    Any ideas ?

    the code should be fine
    you have a syntax error
    <h:inputText id="name" size="20" value="01/01/2005"/>
    <f:convertDateTime type="date" dateStyle="short"/>
    </h:inputText>
    remove the bracket
    <h:inputText id="name" size="20" value="01/01/2005">
    <f:convertDateTime type="date" dateStyle="short"/>
    </h:inputText>

  • Use Dataobject rows as columns in report

    Hi
    ANy suggestuion son the below scenario
    I have a Data object
    With fileds
    Zone Partner Count
    South Jon 234
    South MIke 334
    North Jon 2323
    West Jon 3232
    West Ali 080
    I want to make a list view
    like below
    Partner South North West
    Jon Sum of count for Jon&South Sum of count for Jon& North
    Mik Sum of count for Mik & South
    Ali Sum of count for Ali & SOuth
    So I need the row content as column...............
    Revert with your suggestions
    partner, south ,North, West will be column names

    I need the sum of count ( I think this will give the sum of South, west , north)
    My column names would be Partner,North, South , west ..
    Content for partner coulumn should be Partner names, and content for south , west north should be sum of count for a particular partner.
    e. Partner A SOuth COunt 20
    Partner A South COunt 30
    Partner A west count 40
    so the list shoul dhave
    Partner SOuth West
    A 50 40

  • File Attachements

    I have a problem with file attachements.
    Ther are two types of attachements, FileAttachements as annotations, or attachements as DataObjects, I tried.
    I have to solve this problem:
    Using JS, I have to import a FileAttachement into the my document, and the user has to open it, both in Acrobat pro AND in Reader (with form support).
    (all cause of accessibility, using just a button).
    In Acro pro I can use DataObjects to import an open, but, in Reader I can only open an attachement, but not add it.
    Coul I therfore use FileAttachement as an annotation?
    I tried this code, but there was no result in adding the the file.
    >var annot = this.addAnnot({
    page: 0,
    type: "FileAttachment",
    contents: "File description",
    author: "A. C. Robat",
    name: "C/temp/Testseite.pdf",
    path: "C/temp/Testseite.pdf",
    rect: [540, 540]
    The symbol has been placed correctly, and in the annotation window, there are informations like author, description ...
    But no File has been attached.
    What is wrong?
    And how could I open the attached file of an annotation?
    I did not find any description...
    Could anyone help?

    At this time playing WAV files from attachments is not possible. You may want to Submit feedback on this and put in a request for it to be a added feature.
    http://www.apple.com/feedback/iphone.html
    Customers feedback influences changes the most.

  • Content Conversion Module with the J2EE JMS Adapter

    HI,
    I am following this PDF
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50061bd9-e56e-2910-3495-c5faa652b710
    I have done according to No 3 (page 5) and No 3.1 (page 6),
    but in Adapter Monitor I am getting the following error
    Error: Module exception java.lang.ClassCastException found
    what is this error and where I have to check
    Help pls
    Thanks
    dushanth
    Message was edited by:
            dushanth ry
    Message was edited by:
            dushanth ry

    hi
    Try with this
    Check the library files(aii_af_mp.jar, aii_af_ms_api.jar and aii_af_trace.jar ) are inside the EAR. If this is the case, delete them before deploying
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    ClassCastException using Moduleprocessor
    Module developemnt: casting to Message
    Thanks

  • ADF UIX programatic data binding

    Oracle ADF UIX Developer's Guide mentions the possibility to use the UIX framework in Java, to create new objects or alter the existing ones.
    E.g. we can create a table using a construct like:
    TableLayoutBean tlb = new TableLayoutBean();
    The same document demonstrates the data binding:
    BoundValue rows = new DataBoundValue(_YOUR_NAMESPACE, YOURNAME, "rows");
    tlb.setIndexedNodeList(new DataObjectListNodeList(rows));
    For "simple" attributes using DataObject DataObjectList, etc. the procedure is clear. But what about creating a data bound table or input text:
    <table model="${bindings.EmpView1}" ... >
    <messageTextInput model="${bindings.DeptCode}"/>
    It’s easy to understand that model="${bindings.EmpView1}" or model="${bindings.DeptCode}" are equivalent to multiple attribute bindings (data, validation, read-only, etc.), but it looks that the classes/methods resolving these equivalences and linking the bean to the corresponding DCControlBinding, are not public (or maybe I was not able to find them).
    How can we obtain programmatically, in Java, the same structure as described above (in XML)? The best would be to use the same classes used when the UIX XML document is parsed to create the page description.
    It would be very nice to be able to use a structure like
    tbl.setModel( new JUCtrlRangeBinding(...) );
    txt.setModel( new JUCtrlValueBinding(...) );
    or maybe
    txt.setAttribute( "model", new TextInputModelBoundValue(...) ) etc.
    In JSF we can do something like:
    ValueBinding vb = application.createValueBinding(value);
    component.setValueBinding(attributeName, vb);
    Can we do something similar in UIX?
    Any help will be appreciated,
    thanks,
    Mircea Ionita

    Since the code is already written, it's a pity that we can't use/extend it. I don't like to say it (sorry) but I find this design choice (implement the "model" only into the XML parsing layer) a little bit strange (or maybe I don't understand... ;-) ). We should (or we are supposed to) be able to do in java everything that we can do in XML.
    I would like to find more support/help for the programmatic approach. I have the feeling that you are too focalised on "use-our-state-of-the-art-tools/wizards-to-write-the-code-for-you" and you forgot that this is not suitable for all projects. E.g. our application creates the user interface according to a layout defined by each user. To generate it, we need to use at maximum the extension mechanism and we can't simply relay on "rendered" attribute etc.
    -When should we expect this new UIX release?
    -What about the UIX controller? The Struts controller will replace it?
    -What about the source code of uixexp2-demo.jar (distributed with ADF_UIX_component_guide)?
    -Why while debugging we can't set a method/class breakpoint on UIX classes (to understand the data flow) - the stack is secret?
    Thanks

  • Displaying HttpRequest Parameter in UIX page

    Hi team,
    On one page I select a value from a dropdown list - this gets saved as a request parameter on the sessionData (standard behaviour).
    16:06:57 DEBUG (JhsActionServlet) -Parameter Shipment: 121What I want to do is refer to that value in a subsequent UIX page. I thought that I would be able to use
    <dataObject select="Shipment" source="jheadstart:sessionData"/>but it returns null. Also, using a custom handler, I can access the value by using
    String shipmentId = sessionData.getRequestParameter("Shipment");
    or
    String shipmentId = sessionData.getAttribute("Shipment",true).toString();
    but not
    String shipmentId = sessionData.getAttribute("Shipment").toString();The last returns a NullPointer exception - which is no doubt why no value is displayed on my UIX page. How come using the overloaded version of the getAttribute method("Shipment",true) works but not just ("Shipment"). I thought the standard method is supposed to check in all locations (HttpSession, HttpRequest and ServletContext) anyway ??
    Also, what databinding do I need in my UIX page to access this "Shipment" request parameter.
    Many thanks,
    Brent

    Brent,
    Apart from what the standard method is supposed to do, is the difference that getAttribute(String, boolean) with boolean="true" not only checks the session but also the request itself (that's where the boolean is for). The getRequestParameter() only checks the request. That is why getAttribute("Shipment", true) and getRequestParameter() both get the value, while getAttribute("Shipment") doesn't.
    The request parameter is not automatically stored as a data object. You could do this using a custom action that retrieves the parameter using e.g. getRequestParameter(), create a UIX data object based on that and put that on the session. Than you can refer to it in a next page using getAttribute().
    Having said this, I wonder if there is not a much simpler method to retrieve request parameters from the session. If I were you, I would post these same question on the JDeveloper forum to see if that is possible.
    HTH, Jan Kettenis
    JHeadstart Team

Maybe you are looking for

  • Why does Time machine still ask for a disk when it is switched off?

    My Time Capsule recently died, PSU problems , I think. So I went into system prefs and deselected the Time Capsule as the back-up disk in Time Machine and switched off Time Machine. Yet every few minutes I get a window appearing telling me Time Machi

  • Exporting to Flash Issues

    Okay, I have done EVERYTHING I can think of to get the export to Flash to work with Captivate. However, I am at a loss now. I keep getting this really weird error message: "Windows cannot find '#$^&\Flash.exe.' Make sure you typed the name correctly,

  • Why do we need material specification for transfering results to class char.

    Hi, Can you guys tell me why do we need to create material specification if we want to transfer quality inspection results to a batch class? Basically I have done the following: -Create Class Characteristic -Assign the Class Characteristic to a batch

  • How to enable Serach term 1 in Webclient UI

    Hi, I am new to this forum, wants to know how  to enable search term 1 and search term 2 fields in Webclient UI to perform search, where as these fields are showing results in GUI environment but not with UI environment. Best Regards

  • I'm getting no sound when I receive a call or text?

    I'm getting no sound when I receive a call or text?  Any suggestions