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>

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.

  • Validating Dates in JSF using convertDateTime an overriding message format

    Have seen a way to validate dates with this kind of code snippet:
             <h:inputText id="departDate"
                value="#{flight.departDate}">
               <f:convertDateTime pattern="dd/MM/yy"/>
             </h:inputText>
             <h:message for="departDate"/>-----
    This results in an ugly default error message when things go wrong like so:
    j_id_jsp_1447383442_1:departDate: 'a' could not be understood as a date. Example: 28/02/08
    Is there a way I can override this by using some sort of message placeholder, so I get a message like:
    *"Depart Date 's' is invalid"*
    So placeholder message would be *"[0} {1} is invalid"*, where parm *0* would be *"Depart Date"* and parm *1* would be value *"#{flight.departDate}"*.
    I know you can resort to a full blown custom converter class, but I was wondering if I could put a message formatted with placeholders directly into the code snippet.
    Is this feasible?

    After several more iterations of testing, I discovered the problem is actually due to using the trinidad rendering kit. Part of my migration to 1.2 involved experimenting with the use of the trinidad components. I thought I had removed all the trinidad stuff from my application during testing of this date problem, but I discovered that I had left the following in:
    web-app library:    trinidad-1.2.10
    faces-config.xml entry:
        <default-render-kit-id>
                org.apache.myfaces.trinidad.core
        </default-render-kit-id>once these items were removed, the application worked as expected. So it looks like the problem is with the trinidad rendering kit/library.
    Edited by: emprice26 on Aug 11, 2009 6:02 PM

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

  • 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

  • Facing issue regarding convertDateTime

    hi friends,
    i am using jdeveloper 11.1.1.6.0 . i am using convertDateTime for calender . it is accepting MM/DD/YYYY this format only(ex 3/18/2013) but if user is putting something like this MAR-18-2013 , it is throwing an error invalid date format. but the problem is that system not allowing the user to navigate to other screen. every time it's throwing same the error .
    thank you.

    Did you visit any of these?
    Using af:calendar component in adf
    http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_calendar.htm
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_calendar.html
    http://www.oracle.com/technetwork/developer-tools/jdev/calendar-091799.html
    Alternatively you can try this.
    <af:inputDate value="#{bindings.MyDateField.inputValue}"
    label="#{bindings.MyDateField.hints.label}"
    required="#{bindings.MyDateField.hints.mandatory}"
    shortDesc="#{bindings.MyDateField.hints.tooltip}"
    id="id1">
    <f:validator binding="#{bindings.MyDateField.validator}"/>
    <af:convertDateTime pattern="#{bindings.MyDateField.format}"/>
    </af:inputDate>
    MyDateField is an attribute in entity based view object in model/BC project.

  • ConvertDateTime problem

    Hello
    I am using convertDateTime but having some problems..
    <t:inputText id="endDate" value="#{editSurvey.endDate}" forceId="true">
         <f:convertDateTime pattern="dd/MM/yyyy" />
    </t:inputText>Value for endDate in database is 30/11/2006.
    Value for endDate in editSurvey bean is the same.
    But on the page, convertDateTime prints it as 29/11/2006. Whatever the date is, convertDateTime prints the day before.
    Is this a bug, or am I doing something wrong?
    I am using MyFaces Impl - version 1.1.4
    Thanks for your help
    Yusuf.

    Hello,
    Just 2 hints... something like this happened to me.
    1) reading a date from database (resultSet) requires to get the value into
    java.sql.Date, and not into java.util.Date. I don't remember the exact effect
    of not using the right one.
    2) From client's side, your browser probably understands that you do
    not live in US. (I may guess that because, like me, you prefer
    day/month/year format :-) ).
    But if you don't configure manually your tomcat server with the correctLocale,
    maybe he wants to translate your value into US time.
    It's a nonsense but the same milliseconds quantity is displayed differently
    if the timezone is different. (And then you will have a problem with your
    birthdate passport at US frontier...)
    To be short, and just for testing, maybe you could try to give the locale
    name in your tag? Example:
         <t:inputText id="endDate" value="#{editSurvey.endDate}" forceId="true">
              <f:convertDateTime pattern="dd/MM/yyyy" locale="Locale.SPAIN" />
         </t:inputText>

  • 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

  • Formatting Date in JSPX

    Hi All,
    I am using jdev 11.1.1.4.0
    I want to format the date on JSPX.
    table on JSPX is VO based, currousponding VO attrubute is, OptionValueDate having type as is String.
    It doesn't have EO.
    I am using convertDateTime like this,
    <af:column sortProperty="#{bindings.DepositeLogVO1.hints.OptionValueDate.name}"
                     headerText="#{bindings.DepositeLogVO1.hints.OptionValueDate.label}"
                     id="c7">
                     <af:outputText value="#{row.OptionValueDate}"
                                            id="ot7">
                                            <af:convertDateTime pattern="dd-mmm-yyyy"/>
                     </af:outputText>
    </af:column>Still not showing the date in a specific format.
    It shows date as default - e.g. 06 june, 2012.
    But I want it in the format - 06-Jun-2012
    If I change type of attribute in VO from String to Date then it is throwing error as - Illegal argument. Also, I tried TimeStamp as attr type - but not working!!!
    Appreciate your help.
    Thanks and Regards,
    Madhav K.

    Hi,
    you cannot convert string to date directly using convertDateTime..
    .. is your format constant accross all rows..? if yes then you can modify your viewobject sql query as following by change query mode to expert mode..
    EDIT:
    as suggested by arunEDIT:
    select <your select attrs>, to_date(OptionValueDate,'dd MON, yyyy') TempOptionValueDate  from your_table..
    following would be better as you wont need to modify the sql query.....else create a new attr using '+' icon, give it a proper name, check 'mapped to column or sql' , give a proper alias, in expression set following
    to_date(<your_db_column_name>,'dd MON, yyyy')then for the newely defined attribute i.e TempOptionValueDate , edit the attr by clicking pencil icon, goto 'Control Hints' change format to 'dd-MMM-yyyy'..
    the one you want.. but in strict format as defined by SimpleDateFormat in java..
    same format option applies for af:convertDateTime...
    Hope this helps....
    Regards,
    Edited by: Santosh Vaza on Jun 1, 2012 4:45 PM

Maybe you are looking for

  • HT204053 Can i use one apple ID on two different computers?

    I would like to sync my contacts and my calendar between an iMac at home, and a MacMini in my shop. Thanks in advance. Toon.

  • Apple ID changes do not stick

    Since a week or two, my Apple ID which is also my principal email mac.com address is not recognized on the Apple support communities board. But it works correctly for email, MobileMe connections, Apple and iTunes stores. If I go to the Apple ID page

  • DB Copy (MSSQL) between two SAP systems with different level and Components

    Hi, we have a SAP system release mysap 2004 SR1 and for "the upgrade project  to SAP ECC 6.0 " we installed a new mysap 2004 in a new hardware (sap03) where we have also solution manager running. The new installed Mysap 2004 SR1 is alos running fine

  • IMac configuration

    Hello. I've recently received a configuration for an iMac and I'm a little bit confused. iMac 21.5 - inch.Dual core i5(2.7 Ghz,3MB)/8 GB DDR3 1600 Mhz,HDD - 500 GB - 5400 RPM,256 GB Flash,Intel Graphics 5000,Camera FaceTime HD,Slot Card SDXC,10/100/1

  • Helppppp frozen

    ok i was driving to class this morning and the ipod was working fine and i went to skip to another song and it froze...wont shut off and wont do anything when i connect it to the computer...and hold is off....anyone know what i can do? thanks eric