ClassCastException in f:param

Hi All,
I'm populating DataTable, in first column i'm rendering commandLink and works fine, but adding f:param in link throws ClassCastException:"java.lang.Long cannot be cast to java.lang.String". my param is id from Entity:
<webuijsf:tableColumn headerText="Cuenta" id="tableColumn5" noWrap="true">
    <h:commandLink action="#{ConsultaSuscriptor.linkCuentaAction}" id="linkCuenta" value="#{currentRow.value['cuenta']}">
        <f:param name="cuenta" id="cuenta" value="#{currentRow.value['cuenta']}" />
    </h:commandLink>
</webuijsf:tableColumn>currentRow is instanceof Suscriptor with cuenta atribute as Long.
does f:param only accept String as value? How can I send my id to another page?
Thanks for your replies,
Regards.

how about
<h:outputText value="#{param.XXX}"....>
the #{param.XXX can call the param u pass from the previous page
I m also new to it and below is the thread that i post. It might help you on it.
http://forum.java.sun.com/thread.jspa?threadID=650526&tstart=0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • XMLBEANS  classcastexception issues when migrating from WLS 8.1 to WLS 9.2

    Hi
    We are migrating our applications from Weblogic 8.1 / xbean (?) to Weblogic 9.2 / apache xbean 2.2.9-r540734 .
    We compiled our schema successfully with new version after making changes recommended by bea (replaced all com.bea.xml occurrences to org.apache.xmlbeans ) along with ant task def etc.
    XBEAN Compilation produces classes in following package structure: com.tuftshealth.container.providerListService.* and com.tuftshealth.container.providerListService.impl.*
    Our XSD looks like below:
    ===============================
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:this="http://www.tuftshealth.com/Container/ProviderListService" xmlns:messageheader="http://www.tuftshealth.com/Base/MessageHeader" xmlns:name="http://www.tuftshealth.com/Base/Name" xmlns:status="http://www.tuftshealth.com/Base/Status" xmlns:network="http://www.tuftshealth.com/Base/Network" xmlns:date="http://www.tuftshealth.com/Base/DateRange" xmlns:contact="http://www.tuftshealth.com/Base/Contact" xmlns:address="http://www.tuftshealth.com/Base/Address" xmlns:reference="http://www.tuftshealth.com/Base/Reference" xmlns:member="http://www.tuftshealth.com/Base/Member" xmlns:benefit="http://www.tuftshealth.com/Base/Benefit" xmlns:covlimit="http://www.tuftshealth.com/Base/CoverageLimitations" xmlns:groupriders="http://www.tuftshealth.com/Base/GroupRiders" xmlns:buslninfo="http://www.tuftshealth.com/Base/BusinessLineInfo" xmlns:phone="http://www.tuftshealth.com/Base/Phone" targetNamespace="http://www.tuftshealth.com/Container/ProviderListService" elementFormDefault="qualified">
         <import namespace="http://www.tuftshealth.com/Base/MessageHeader" schemaLocation="../Base/MessageHeader.xsd"/>
         <element name="ProviderListRequest" type="this:PrivderListServiceRequestType"/>
         <complexType name="PrivderListServiceRequestType">
              <sequence>
                   <element name="MessageHeader" type="messageheader:MessageHeaderType"/>
                   <element name="providerRequestInfo" type="this:ProviderListRequestParamsType"/>
    =================================
    This results in exceptions at run time when we call a Tibco using a generic broker class.
    The broker uses following method to return class to us:
    obj = XmlObjectBase.Factory.parse(XMLString);
    XMLString contains following payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ProviderListResponse xmlns:ns0="http://www.tuftshealth.com/Container/ProviderListService">
    Debug Info:
    PACKAGE NAME: **** com.tuftshealth.www.container.providerlistservice.impl
    CLASS NAME: ****** com.tuftshealth.www.container.providerlistservice.impl.ProviderListResponseDocumentImpl
    java.lang.ClassCastException: com.tuftshealth.www.container.providerlistservice.impl.ProviderListResponseDocumentImpl
    XmlObjectBase is returning the class with www in package name. This causes ClassCastException.
    We tried to use XmlObject and XmlOptions is various combinations to see if "www" in package name goes away but it stays the same.
    Can someone please help us here ? It seems that behavior of XmlObject or XmlObjectBase has changed between two versions. Our apps can't work without the broker to return correct class type.
    Thanks for your help,
    Shikhar

    Hi,
    You can get rid of JSP version specific problems by using the following weblogic.xml file:-
    <weblogic-web-app>
    <jsp-descriptor>
    <jsp-param>
    <param-name>backwardCompatible</param-name>
    <param-value>true</param-value>
    </jsp-param>
    </jsp-descriptor>
    <weblogic-web-app>
    It will also confirm if the error you are seeing is due to JSP version differences in 8.1 and 9.x.
    Regards.

  • Java.lang.ClassCastException in simple struts application. please help me!

    I have a simple struts application, it only have a login form. however, it's alway throw java.lang.ClassCastException when I submit the form. Here is full stack trace:
    14-03-2007 17:04:50 org.apache.struts.chain.ComposableRequestProcessor init
    INFO: Initializing composable request processor for module prefix ''
    14-03-2007 17:04:50 org.apache.struts.chain.commands.servlet.CreateAction getAction
    INFO: Initialize action of type: ndlinh.struts.lab.RegistrationForm
    14-03-2007 17:04:50 org.apache.struts.chain.commands.AbstractExceptionHandler execute
    WARNING: Unhandled exception
    java.lang.ClassCastException: ndlinh.struts.lab.RegistrationForm
         at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:66)
         at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:82)
         at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    14-03-2007 17:04:50 org.apache.struts.chain.commands.ExceptionCatcher postprocess
    WARNING: Exception from exceptionCommand 'servlet-exception'
    java.lang.ClassCastException: ndlinh.struts.lab.RegistrationForm
         at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:66)
         at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:82)
         at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Here is my code:
    package ndlinh.struts.lab;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class RegistrationForm extends ActionForm {
         private String userid = null;
         private String password = null;
         private String password2 = null;
         public RegistrationForm() {
              System.out.println("************ Registration Form created *************");
          * @return the password
         public String getPassword() {
              return password;
          * @param password the password to set
         public void setPassword(String password) {
              this.password = password;       
          * @return the password2
         public String getPassword2() {
              return password2;
          * @param password2 the password2 to set
         public void setPassword2(String password2) {
              this.password2 = password2;
          * @return the userid
         public String getUserid() {
              return userid;
          * @param userid the userid to set
         public void setUserid(String userid) {
              this.userid = userid;
         public void reset(ActionMapping arg0, HttpServletRequest arg1) {
              userid = "";
              password = "";
              password2 = "";
    package ndlinh.struts.lab;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public final class RegistrationAction extends Action {
         public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
                                             HttpServletRequest request, HttpServletResponse response)
              try {
                   System.out.println("*******************" + actionForm.toString() + "*******************");
                   RegistrationForm form = (RegistrationForm)actionForm;     
                   String username = form.getUserid();
                   String password = form.getPassword();
                   System.out.println(username);
                   // simple login checking.
                   // if userid equals password, user can login to system
                   if ( username.equalsIgnoreCase(password)) {
                        return mapping.findForward("success");
                   } else {
                        return mapping.findForward("failure");
              } catch (Exception e) {
                   e.printStackTrace();
                   return mapping.findForward("failure");
    }registration.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
         <html:form action="/register">
              Username: <html:text property="userid" /> <br />
              Password: <html:password property="password" /> <br />
              Re-type: <html:password property="password2" />
              <html:submit value="Register" />
         </html:form>
    </body>
    </html>struts-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      <form-beans>
           <form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
      </form-beans>
      <action-mappings>
           <action path="/register"
                   type="ndlinh.struts.lab.RegistrationForm"
                   name="registrationForm"
                   validate="false"
                   scope="request"
                   input="registration.jsp" >
                <forward name="success" path="/jsp/success.jsp"  />
                <forward name="failure" path="/jsp/failure.jsp"  />
           </action>
      </action-mappings>
    </struts-config>web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
    </web-app>System information:
    Tomcat 5.5.20
    Struts 1.3.5
    JDK1.5.08

    struts-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      <form-beans>
           <form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
      </form-beans>
      <action-mappings>
           <action path="/register"
                   type="ndlinh.struts.lab.RegistrationAction" // action class
                   name="registrationForm" // form bean name
                   validate="false"
                   scope="request"
                   input="registration.jsp" >
                <forward name="success" path="/jsp/success.jsp"  />
                <forward name="failure" path="/jsp/failure.jsp"  />
           </action>
      </action-mappings>
    </struts-config>HTH

  • ClassCastException on classLoader

    Hi everybody,
    I'm having a bit of a problem with some reflection code and I can't work it out.
    I have a method which get as as one of its parameters a class that implements an interface where resides the method I'm interested in to execute, something like
    public void theMethod(Class<? extends InterfaceType> c) {
        InterfaceType it = null;
        try {
            it = (InterfaceType) c.getClassLoader();
            it.desiredMethod(String param);
        } catch (Exception e) {
            e.printStackTrace();
    }But at the ip = (InterfaceType) c.getClassLoader(); i get the following exception
    java.lang.ClassCastException: java.net.FactoryURLClassLoader
    Any help is help, thanks in advance.

    Joking aside, are you perhaps looking for
    InterfaceType it = c.newInstance();
    it.desiredMethod( param );?

  • ClassCastException on Deployment in Weblogic 10.3

    When I am deploying my application in Weblogic 10.3, I am getting below Exception.
    weblogic.application.ModuleException:
    com.ctc.wstx.stax.WstxInputFactory cannot be cast to javax.xml.stream.XMLInputFactory
    Earlier I had no problem with Weblogic 8.1.

    I have the exact same issue. I'm trying to deploy a project that uses CXF 2.1 which uses the StaX parser. Here's what I've tried to do:
    In my weblogic.xml, I have the following set to prefer the libraries I have in my WEB-INF/lib:
    <wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
    http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
         <wls:context-root>PCRSubmittal</wls:context-root>
         <wls:weblogic-version>10.3</wls:weblogic-version>
         <wls:container-descriptor>
              <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
         </wls:container-descriptor>
    </wls:weblogic-web-app>Then I created a weblogic-application.xml that has the StaX parser defined as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-application
         xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-application"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd
    http://www.bea.com/ns/weblogic/weblogic-application
    http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
         <!-- server-version: 10.3 -->
         <wls:application-param>
              <wls:param-name>javax.xml.stream.XMLInputFactory</wls:param-name>
              <wls:param-value>com.ctc.wstx.stax.WstxInputFactory</wls:param-value>
         </wls:application-param>
         <wls:application-param>
              <wls:param-name>javax.xml.stream.XMLOutputFactory</wls:param-name>
              <wls:param-value>com.ctc.wstx.stax.WstxOutputFactory</wls:param-value>
         </wls:application-param>
         <wls:application-param>
              <wls:param-name>javax.xml.stream.XMLEventFactory</wls:param-name>
              <wls:param-value>com.ctc.wstx.stax.WstxEventFactory</wls:param-value>
         </wls:application-param>
         <wls:application-param>
              <wls:param-name>webapp.encoding.default</wls:param-name>
              <wls:param-value>UTF-8</wls:param-value>
         </wls:application-param>
         <wls:prefer-application-packages>
              <wls:package-name>javax.jws.*</wls:package-name>
              <wls:package-name>javax.xml.stream.*</wls:package-name>
              <wls:package-name>com.ctc.wstx.*</wls:package-name>
         </wls:prefer-application-packages>
    </wls:weblogic-application>When I deploy I get the following exception:
    Caused by: java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to javax.xml.stream.XMLInputFactory
         at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:137)
         at weblogic.servlet.internal.TldCacheHelper$TldIOHelper.parseXML(TldCacheHelper.java:124)
         at weblogic.descriptor.DescriptorCache.parseXML(DescriptorCache.java:380)
         at weblogic.servlet.internal.TldCacheHelper.parseTagLibraries(TldCacheHelper.java:65)
         at weblogic.servlet.internal.War.getTagInfo(War.java:891)
         at weblogic.servlet.internal.WebAppServletContext$ServletContextWebAppHelper.getTldInfo(WebAppServletContext.java:3612)
         at weblogic.servlet.internal.WebAppServletContext$ServletContextWebAppHelper.getTagLibHandlers(WebAppServletContext.java:3590)
         at weblogic.servlet.internal.WebAnnotationProcessorImpl.processAnnotations(WebAnnotationProcessorImpl.java:112)
         at weblogic.servlet.internal.WebAppServletContext.processAnnotations(WebAppServletContext.java:1287)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:412)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:456)
         at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:414)
         at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:910)
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:364)

  • ClassCastException from appendSecondaryDocument( non-oracle-generated-XMLDocument i )

    I wrote an xsql custom handler that converts html to xhtml and includes it into my xsql-generated xml.
    It gets slow because appendSecondaryDocument() throws a ClassCastException if I pass in a (XML) Document that is generated by the parser in JTidy.
    I therefore have to reparse this document using Oracle parser, which degrades performance too much.
    Is there any way to avoid this reparsing?
    I included code that shows the problem, the code relies on the JTidy library, which may be downloaded from:
    http://sourceforge.net/projects/jtidy/
    <pre>
    package nki.nettskolen.xsql;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import oracle.xml.parser.v2.*;
    import oracle.jdeveloper.cm.ConnectionManager;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.xsql.*;
    import oracle.xml.xsql.actions.*;
    /** This class provides functionality for including html (as xhtml)
    into an xsql-page. Usage:
    <xsql:include-html src="../../main.html"/>
    @author Tommy Skodje, NKI 2001.
    public class HtmlImporter2 extends XSQLActionHandlerImpl {
    String mUrl = null;
    boolean mRelative = false;
    /** Get url to the resource u want to include */
    public void init(XSQLPageRequest req, Element action) {
    super.init(req, action);
    mUrl = action.getAttribute( "src" );
    } // init()
    /** Read the html file, convert to xhtml, and add to result. */
    public void handleAction(Node result) {
    InputStream in = null;
    try {
    org.w3c.tidy.Tidy tidy = new org.w3c.tidy.Tidy();
    tidy.setXHTML( true );
    tidy.setQuiet( true );
    XSQLServletPageRequest xspr = (XSQLServletPageRequest)getPageRequest();
    String requestType = xspr.getRequestType();
    if ( ! requestType.equals("Servlet"))
    return;
    HttpServletRequest req = xspr.getHttpServletRequest();
    HttpServletResponse res = xspr.getHttpServletResponse();
    String text = "<html><head></head><body><br>Hello World!</body></html>";
    in = new ByteArrayInputStream( text.getBytes() ); // dummy: get resource as stream
    // PassPostRequestServlet.getStream( mUrl , req , res );
    ByteArrayOutputStream outBuf = new ByteArrayOutputStream();
    Document xDoc = tidy.parseDOM( in , outBuf );
    // tsk FixMe: ClassCastException if used directly, why? appendSecondaryDocument( result , tidy.parseDOM( in , Logg.getStream() ) );
    InputStream inBuf = new ByteArrayInputStream( outBuf.toByteArray() );
    xDoc = readXMLDoc( inBuf );
    appendSecondaryDocument( result , xDoc );
    } catch ( Exception e ) {
    String msg = "Exception in XSQLImporter.handleAction(), url=" + mUrl;
    System.out.println( msg + e.getMessage() );
    } finally {
    close( in );
    } // handleAction()
    /* Parses and instantiates an XML document from stream (which is then closed)
    @param ByteArrayInputStream stream of textual data (from String, file etc)
    @return XMLDocument instantiated from contents of stream
    public XMLDocument readXMLDoc( InputStream source ) {
    DOMParser theParser = new DOMParser();
    try {
    //the parser works faster in nonvalidation mode
    theParser.setValidationMode(false);
    theParser.parse( source );
    } catch ( Exception e ) {
    String msg = "Exception in readXMLDoc(): " + e.getMessage();
    System.out.println( msg );
    } finally {
    close( source );
    return theParser.getDocument();
    }// end hentXMLDoc
    /** Closes the stream */
    public static void close( InputStream s ) {
    if ( s != null ) try {
    s.close();
    } catch ( Exception e ) { }
    } // close()
    /** Closes the stream */
    public static void close( OutputStream s ) {
    if ( s != null ) try {
    s.close();
    } catch ( Exception e ) { }
    } // close()
    } // class HtmlImporter
    </pre>

    Looks like you already figure this one out, but basically the XSQL Page Processor expects the DOM implementation that is used to be the fast Oracle DOM implementation for performance reasons.

  • ClassCastException by using deployed resource adapter

    Dear community team,
    I try to create an connection for my web application (war file) running on SAP Web Application Server to access an enterprise information system (Apache JackRabbit) by using JCA and deployed resource adapter. The resource adapter "jackrabbit-jca-1.3.3.rar " is provided Apache Jackrabbit.
    http://jackrabbit.apache.org/downloads.cgi
    I changed some deployment descriptor configuration and deployed it successfully by using Deployment Tools. With the Visual Administrator I also could check the JNDI object and finded an entry in connector container.
    The JNDI lookup worked fine and it returned a object type "JCARepositoryHandle" (I could analyse its type and attributes in debugging modus).If I tried to cast the object "JCARepositoryHandle", I got an ClassCastException.
    Do you have any adoption why I only saw the returned object "JCARepositoryHandle" in debugging modus but it wasnt possible cast and to use it.
    If you need any more information, please let me know.
    Thanks for your support.
    PS: Please have also a look in the attached source an configuration files:
    Java servlet class
    ===================================================================
    Connection connection = null;
          Context initctx = null;
             try {
              //get the initial JNDI context
              Hashtable env = null;
              initctx = new InitialContext();
             // perform JNDI lookup to get the connection factory
             JCARepositoryHandle rep = (JCARepositoryHandle)initctx.lookup("deployedAdapters/jcr/Repository/shareable/jcr/Repository");
    connector-j2ee-engine.xml
    ===================================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE connector-j2ee-engine SYSTEM 'connector-j2ee-engine.dtd'>
    <connector-j2ee-engine>
         <jndi-name>jcr/Repository</jndi-name>
         <pool-params>
              <max-connections-number>10</max-connections-number>
              <max-time-to-wait-connection>120</max-time-to-wait-connection>
              <expiration-control>
                   <connection-lifetime>900</connection-lifetime>
                   <run-cleanup-thread>300</run-cleanup-thread>
              </expiration-control>
         </pool-params>
    </connector-j2ee-engine>
    ra.xml
    ===================================================================
    <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE connector PUBLIC
            '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN'
            'http://java.sun.com/dtd/connector_1_0.dtd'>
        <connector>
          <display-name>Jackrabbit JCR Adapter</display-name>
          <vendor-name>Apache.org</vendor-name>
          <spec-version>1.0</spec-version>
          <eis-type>JCR Adapter</eis-type>
          <version>1.6</version>
          <license>
            <description>Not required</description>
            <license-required>false</license-required>
          </license>
          <resourceadapter>
            <managedconnectionfactory-class>org.apache.jackrabbit.jca.JCAManagedConnectionFactory</managedconnectionfactory-class>
            <connectionfactory-interface>javax.jcr.Repository</connectionfactory-interface>
            <connectionfactory-impl-class>org.apache.jackrabbit.jca.JCARepositoryHandle</connectionfactory-impl-class>
            <connection-interface>javax.jcr.Session</connection-interface>
            <connection-impl-class>org.apache.jackrabbit.jca.JCASessionHandle</connection-impl-class>
            <transaction-support>XATransaction</transaction-support>
            <config-property>
              <config-property-name>HomeDir</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value>C:/temp/repository</config-property-value>
            </config-property>
            <config-property>
              <config-property-name>ConfigFile</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value>C:/temp/repository/repository.xml</config-property-value>
            </config-property>
            <reauthentication-support>false</reauthentication-support>     
          </resourceadapter>
        </connector>

    The reason for the ClassCastException was the class loader issue.

  • ClassCastException when castin to a SessionEJBHome after successful lookup

    Situation
    Two EARs, say X.ear and Y.ear. Both of them deployed in the same OC4J instance (NOT STANDALONE); OAS 10.1.2
    X.ear has a JAR (say XA.jar) which looksup and uses the Stateless Session bean in Y.ear. We have a yClient.jar that contains all the necessary classes for use by X.ear, so XA.jar. This yClient.jar is available in X.ear.
    In one of the classes in XA.jar, when I lookup the EJB, I am succesful in getting the Home class. If I try to narrow down to the specific Home class instead of EJBHome.class, then I get the ClassCastException at that moment. If I cast it to EJBHome.class and postpone casting until after creation of the real remote bean, then I get the ClassCastException here.
    I have included the code also.
    Possible doubts that I am having:
    1)
    I am doubting like OAS is doing something that I am not aware of. Like the remote object it sends back and when I am casting it to the class of the object it throws ClassCastException.
    Y.ear does not contain any info like a Jar in X.ear is going to lookup this bean or so.
    Do I need to mention anything in Y.ear.
    2)
    Is there any possiblility that the same class in X.ear and Y.ear are compiled with different JDK or timing
    3) Or is the OAS Stub creation or persistence or passivation is messing up in this.
    I am kind of stuck in here. Thanks for your help
    If you notice the following exception, I have printed the SessionBean narrowed down class. It is a wrapper class from OC4J I believe.
    [u]SessionControllerSLHome_StatelessSessionHomeWrapper61
    This is what is in the orion-ejb-jar.xml
    <session-deployment name="SessionControllerSL" max-tx-retries="0" location="com/dsc/uniarch/cr/ejb/SessionControllerSL" wrapper="SessionControllerSLHome_StatelessSessionHomeWrapper61" persistence-filename="com/dsc/uniarch/cr/ejb/SessionControllerSL.home_default_island_1" />
    It seems like the looked up object when I cast it to the corresponding class, it is giving ClassCastException
    Exception
    06/10/27 11:40:13 Tutalii: /home/oracle/OracleAS/j2ee/home/applications/mlo/mloWeb/WEB-INF/classes
    06/10/27 11:40:29 Oracle Application Server Containers for J2EE 10g (10.1.2.0.0) initialized
    06/10/27 11:41:03 EL xPressionConnection Begin start session...
    06/10/27 11:41:03 EL xPressionResponseConnection - getInitialContext ()
    06/10/27 11:41:03 EL xPressionConnection PROVIDER_URL =ormi://localhost:3201/xPression
    06/10/27 11:41:03 EL xPressionConnection INITIAL_CONTEXT_FACTORY =com.evermind.server.rmi.RMIInitialContextFactory
    06/10/27 11:41:03 EL xPressionConnection SECURITY_PRINCIPAL =xpression
    06/10/27 11:41:03 EL xPressionConnection SECURITY_CREDENTIALS =xpression
    06/10/27 11:41:03 2011: After successful JNDI lookup for SessionControllerSL on the Initial Context: [SessionControllerSLHome_StatelessSessionHomeWrapper61]
    06/10/27 11:41:03 2012: After narrowing down the homeObject to EJB Home Object: SessionControllerSLHome_StatelessSessionHomeWrapper61
    06/10/27 11:41:03 2013: Used reflection to invoke the Create method on EJBHome Object: SessionControllerSL_StatelessSessionBeanWrapper60
    06/10/27 11:41:03 java.lang.ClassCastException
    06/10/27 11:41:03 at com.dsc.uniarch.ejbController.xPressionConnection.lookupTargetHome1(xPressionConnection.java:152)
    06/10/27 11:41:03 at com.dsc.uniarch.ejbController.xPressionConnection.Start(xPressionConnection.java:250)
    06/10/27 11:41:03 at com.dsc.uniarch.ecor.bean.xResponseFrameWork.startSession(xResponseFrameWork.java:5381)
    06/10/27 11:41:03 at com.dsc.uniarch.ecor.bean.xResponseFrameWork.processRequest(xResponseFrameWork.java:154)
    06/10/27 11:41:03 at html.index._jspService(_index.java:69)
    06/10/27 11:41:03 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    06/10/27 11:41:03 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)
    06/10/27 11:41:03 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    06/10/27 11:41:03 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
    06/10/27 11:41:03 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    06/10/27 11:41:03 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
    06/10/27 11:41:03 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    06/10/27 11:41:03 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    06/10/27 11:41:03 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
    06/10/27 11:41:03 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
    06/10/27 11:41:03 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    06/10/27 11:41:03 at java.lang.Thread.run(Thread.java:534)
    Code that is used
    try {
    //Third EJB Lookup: CRContentSF
    if (initContext == null)
    getInitialContext();
    homeObject = initContext.lookup("com/dsc/uniarch/cr/ejb/SessionControllerSL");
    System.out.println("2011: After successful JNDI lookup for SessionControllerSL on the Initial Context: ["
    + homeObject.getClass().getName() + "]");
    obHome = (EJBHome) javax.rmi.PortableRemoteObject.narrow(homeObject,
    EJBHome.class);
    System.out.println("2012: After narrowing down the homeObject to EJB Home Object: " + obHome.getClass().getName());
    m = obHome.getClass().getDeclaredMethod("create", new Class[0]);
    obj = m.invoke(obHome, new Object[0]);
    System.out.println("2013: Used reflection to invoke the Create method on EJBHome Object: " + obj.getClass().getName());
    sessionControllerSL = (com.dsc.uniarch.cr.ejb.SessionControllerSL) obj;
    System.out.println("2014: getClass " + sessionControllerSL.getClass().getName());
    System.out.println("3014: getClass " + SessionControllerSL.getClass().getName());
    } catch (Exception e) {
    e.printStackTrace();
    Thanks

    I redeployed the target j2ee application, it does not seem to help. However, after redeploying, I had to stop/start the OC4J instance couple of times. I dont think it matters. Or I dont know if you guys meant this only when you say 'server bounce'.
    What is this SessionBeanWrapper anyways? If it is a EJB-Remote-Stub, then it should be able to cast into its original interface. I dont know what else to do at this point. I will keep working on this.
    EXCEPTION
    06/10/30 13:40:14 EL xPressionConnection Begin start session...
    06/10/30 13:40:14 EL xPressionResponseConnection - getInitialContext ()
    06/10/30 13:40:14 EL xPressionConnection PROVIDER_URL =ormi://localhost:3201/xPression
    06/10/30 13:40:14 EL xPressionConnection INITIAL_CONTEXT_FACTORY =com.evermind.server.rmi.RMIInitialContextFactory
    06/10/30 13:40:14 EL xPressionConnection SECURITY_PRINCIPAL =user
    06/10/30 13:40:14 EL xPressionConnection SECURITY_CREDENTIALS =password
    06/10/30 13:40:14 EL xPressionConnection lookup beanName :com/dsc/uniarch/cr/ejb/SessionControllerSL
    06/10/30 13:40:14 EL xPressionConnection tmpObject : SessionControllerSLHome_StatelessSessionHomeWrapper61
    06/10/30 13:40:14 EL objHome name : SessionControllerSLHome_StatelessSessionHomeWrapper61
    06/10/30 13:40:14 EL xPressionConnection start typecast exception
    06/10/30 13:40:14 java.lang.ClassCastException
    06/10/30 13:40:14 at com.dsc.uniarch.ejbController.xPressionConnection.Start(xPressionConnection.java:235)
    06/10/30 13:40:14 at com.dsc.uniarch.ecor.bean.xResponseFrameWork.startSession(xResponseFrameWork.java:5381)
    06/10/30 13:40:14 at com.dsc.uniarch.ecor.bean.xResponseFrameWork.processRequest(xResponseFrameWork.java:154)
    06/10/30 13:40:14 at html.index._jspService(_index.java:69)
    CODE BEGIN
    System.out.println ("EL xPressionConnection Begin start session...");
    LogManager.logInfo("Begin start session...");
    setServerURL(serverURL);
    initInitContext();
    SessionControllerSLHome scHome = null;
    try {
    scHome = (SessionControllerSLHome)
    lookupTargetHome(ConfigManager.getInstance().getValue("SESSIONCONTROLLER_JNDI"));
    System.out.println ("EL xPressionConnection - scHome className : " + scHome.getClass().getName());
    catch (Exception exc) {
    System.out.println ("EL xPressionConnection start typecast exception ");
    exc.printStackTrace ();
    try{
    //sessionControllerSL = lookupTargetHome1();
    sessionControllerSL = scHome.create();
    } catch (Exception e) {
    System.out.println ("EL xPressionConnection scHome.create Exception ");
    e.printStackTrace();
    String[] param = new String[1];
    param[0] = ConfigManager.getInstance().getValue("SESSIONCONTROLLER_JNDI");
    throw new JNDINamingException(9110, e, param);
    CODE END
    Thanks

  • Java.lang.ClassCastException in struts application

    Hi,
    In application after I perform an insert(data into the DB) operation, the application must then display a list . Currently this is not happening. I can perform the insert operation successfully , but after that i get the following exception:
    java.lang.ClassCastException: org.theclass.candidate.view.SearchForm
         org.theclass.candidate.view.CandidateListAction.execute(CandidateListAction.java:41)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    I dont understand where to look for errors.
    This is my web.xml file :
    <web-app>
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>validate</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!-- The Usual Welcome File List -->
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <!-- Struts Tag Library Descriptors -->
    <taglib>
    <taglib-uri>/tags/struts-bean</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-html</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-logic</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-nested</taglib-uri>
    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-tiles</taglib-uri>
    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
    </taglib>
    </web-app>
    struts-config.xml:
    <struts-config>
         <form-beans>
              <form-bean
              name="candidateForm"
              type="org.theclass.candidate.view.CandidateForm"/>
         <form-bean
              name="listForm"
              type="candidate.ListForm"/>
              <form-bean
              name="searchForm"
              type="org.theclass.candidate.view.SearchForm"/>
         </form-beans>
    <global-forwards>
         <forward
              name="List"
              path="/jsp/list.jsp"/>
         <forward
              name="candidatelist"
              path="/CandidateList"/>
         <forward
              name="Add"
              path="/jsp/addcandidate.jsp"/>
    </global-forwards>
    <action-mappings>
         <action path="/Add"
              name="candidateForm"
              type="org.theclass.candidate.view.AddCandidateAction"
              validate ="true"
              input="/jsp/addcandidate.jsp">
              <forward name="success" path="/CandidateList.do"/>
         </action>
         <action path="/CandidateList"
              type="org.theclass.candidate.view.CandidateListAction"
              name="searchForm"
              scope="request" >
              <forward name="failure" path="/jsp/list.jsp"/>
              <forward name="success" path="/jsp/candidatelist.jsp"/>
         </action>
         <action path="/Edit"
              type="org.theclass.candidate.view.GetCandidateAction"
              name="candidateForm"
              scope="request"
              validate="false" >
              <forward name="success" path="/jsp/editcandidate.jsp"/>
              <forward name="error" path="/CandidateList.do"/>
         </action>
         <action path="/View"
              type="org.theclass.candidate.view.GetCandidateAction"
              name="candidateForm"
              scope="request"
              validate="false" >
              <forward name="success" path="/jsp/viewcandidate.jsp"/>
              <forward name="error" path="/CandidateList.do"/>
         </action>
         <action path="/EditCandidate"
              type="org.theclass.candidate.view.EditCandidateAction"
              name="candidateForm"
              scope="request"
              input="/jsp/editcandidate.jsp"
              validate="true" >
              <forward name="success" path="/CandidateList.do"/>
              <forward name="error" path="/jsp/editcandidate.jsp"/>
         </action>
         <action path="/ViewCandidate"
              name="candidateForm"
              scope="request"
              input="/jsp/viewcandidate.jsp"
              validate="true" >
              <forward name="success" path="/CandidateList.do"/>
              <forward name="error" path="/jsp/viewcandidate.jsp"/>
         </action>
    <action path="/List"
              name="searchForm"
              type="org.theclass.candidate.view.CandidateListAction"
              input="/jsp/list.jsp">
              <forward name="success" path="/jsp/candidatelist.jsp"/>
         </action>
    </action-mappings>
    <!-- Controller Configuration -->
    <controller
    processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
    <!-- Message Resources Definitions -->
    <message-resources parameter="ApplicationResources"/>
    <!-- comment following if struts1.0.x -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config"
         value="/WEB-INF/tiles-defs.xml" />
    <set-property property="moduleAware" value="true" />
    <set-property property="definitions-parser-validate" value="true" />
    </plug-in>
    <!-- end comment if struts1.0.x -->
         <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
              <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    <plug-in className="org.theclass.candidate.view.HibernatePlugin">
    <!-- <set-property property="configFilePath" value="/WEB-INF/src/hibernate.cfg.xml" /> -->
         <set-property property="configFilePath" value="/hibernate.cfg.xml" />
    <set-property property="storeInServletContext" value="true" />
         </plug-in>
    </struts-config>
    Please tell me where am i going wrong. I am running out of time.
    I use struts 1.2.9, JDK 5,tomcat 5.5.17. In CandidateListAction class i have hibernate query language statements(HQL)

    Take a look at the stack trace, it shows you exactly where the error is coming from:
    java.lang.ClassCastException: org.theclass.candidate.view.SearchForm
    org.theclass.candidate.view.CandidateListAction.execute(CandidateListAction.java:41)Line 41 in your CandidateListAction.
    Probably it is failing on a cast of your action form.
    Taking a closer look at your struts-config, you are "chaining" actions.
    Your AddCandidateAction uses the candidateForm, and forwards to CandidateListAction.do
    Your CandidateListAction uses the searchForm.
    That will be the cause of your class cast exception.
    <action path="/Add"
      name="candidateForm"
      type="org.theclass.candidate.view.AddCandidateAction"
      validate ="true"
      input="/jsp/addcandidate.jsp">
      <forward name="success" path="/CandidateList.do"/>
    </action>
    <action path="/CandidateList"
    type="org.theclass.candidate.view.CandidateListAction"
    name="searchForm"
    scope="request" >
    <forward name="failure" path="/jsp/list.jsp"/>
    <forward name="success" path="/jsp/candidatelist.jsp"/>
    </action>Check out: http://struts.apache.org/1.x/faqs/newbie.html#chaining
    Solutions?
    - don't chain actions ;-)
    - use the same action form for both actions (possible?)
    - make the actionForward a "redirect" one. That means a new request, and losing any request parameters/attributes but should prevent this class cast exception.
    Hope this helps,
    evnafets

  • ClassCastException when calling a JMS implemented web service

    Hi,
    I published a Message Driven Bean EJB to WebService using WebLogic 8.1 and servicegen.
    When I try to call it using the automatic generated Web interface, I receive the
    following ClassCastException.
    Do you see what is going wrong?
    Is it a bug?
    Thanks for your help
    Charles
    ClassCastException :
    javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.ClassCastException
    (see Fault Detail for stacktrace) at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:270)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:131)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:439)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:405)
    at weblogic.webservice.server.servlet.ServletBase.invokeMultiOutput(ServletBase.java:322)
    at weblogic.webservice.server.servlet.ServletBase.invokeOperation(ServletBase.java:296)
    at weblogic.webservice.server.servlet.WebServiceServlet.invokeOperation(WebServiceServlet.java:312)
    at weblogic.webservice.server.servlet.ServletBase.handleGet(ServletBase.java:253)
    at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:138)
    at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:232)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97) at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
    I use this and command :
    <servicegen
    destEar="${WAS_APPLICATIONS}/${version}${ear_ws_file}"
    contextURI="${version}WebServices" >
    <service
    JMSDestination="mq_receive"
    JMSAction="send"
    JMSDestinationType="queue"
    JMSConnectionFactory="mq_QCF"
    JMSOperationName="${JMSOperationName}"
    JMSMessageType="${JMSMessageType}"
    generateTypes="True"
    targetNamespace="http://www.francetelecom.com/cristal/${version}Webservices"
    serviceName="${version}"
    serviceURI="/${version}"
    expandMethods="True">
    </service>
    <classpath>
    <pathelement location="${build}" />
    </classpath>
    <classpath refid="classpath" />
    </servicegen>
    My MDB is
    public void ejbCreate () throws CreateException {
         LoggerConfigurator.configure();
    log.debug("called");
    public void onMessage(Message msg)
    log.debug("called");
              try
                   ObjectMessage objMessage = (ObjectMessage)msg;
                   String text = (String)objMessage.getObject();
                   home = lookupHome();
                   Toupper client = (Toupper)
                        PortableRemoteObject.narrow(home.create(), Toupper.class);
                   text=client.toupper(text);               
                   log.error("Toupper="+text);
                   startJMS();
                   sendJMS(text);
                   client.remove();
              } catch (Exception e)
                   e.printStackTrace();

    "mq_receive" is define as a Local JNDI Name of a Foreign JMSDestination.
    And it works when I use it with only the MDB (without WebService)
    Good try,
    Thanks
    Charles
    "Neal Yin" <[email protected]> wrote:
    My best guess is that JNDI name "mq_receive" is not bound as JMS queue.
    Thanks
    -Neal
    "Charles Desmoulins" <[email protected]> wrote in
    message
    news:[email protected]...
    Ok Neal,
    This is the result :
    <!-------------------- REQUEST ---------------->
    URL :
    http://localhost:7001/messageToupperWebServices/messageToupper
    Headers :
    SOAPAction: [""]
    Content-Type: [text/xml]
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoaporg/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:toupper
    xmlns:m="http://www.francetelecom.com/cristal/messageToupperWebservices"><pa
    ram
    xsi:type="xsd:string">sAmple string totransform</param></m:toupper></env:Body></env:Envelope>
    <!-------------------- END REQUEST ------------>
    <!-------------------- RESPONSE --------------->
    URL :
    http://localhost:7001/messageToupperWebServices/messageToupper
    Headers :
    Date=Fri, 11 Jul 2003 14:29:33 GMT
    Server=WebLogic WebLogic Server 8.1 Thu Mar 20 23:06:05 PST 2003246620
    Content-Length=2522
    Content-Type=text/xml
    Envelope :
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fau
    lt><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: java.lang.ClassCastException (see Fault Detail forstacktrace)</faultstring><detail><bea_fault:stacktrace
    >
    xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>j
    ava.lang.ClassCastException
    atweblogic.webservice.component.jms.JMSSendInvocationHandler.invoke(JMSSendInv
    ocationHandler.java:131)
    atweblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.j
    ava:81)
    atweblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.jav
    a:125)
    atweblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:513)
    atweblogic.webservice.server.Dispatcher.process(Dispatcher.java:150)
    atweblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:125)
    atweblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:74)
    atweblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java
    :98)
    atweblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebSer
    viceServlet.java:274)
    atweblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:393)
    atweblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServle
    t.java:244)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1053)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :387)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :305)
    atweblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:6291)
    atweblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
    t.java:317)
    atweblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3575)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2573)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
    </detail></env:Fault></env:Body></env:Envelope>
    <!-------------------- END RESPONSE ----------->
    An exception Exception during processing: java.lang.ClassCastException(see Fault
    Detail for stacktrace)
    javax.xml.rpc.soap.SOAPFaultException: Exception during processing:java.lang.ClassCastException
    (see Fault Detail for stacktrace)
    atweblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:270)
    atweblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:131
    atweblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:439)
    atweblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:425)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:536)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:389)
    at ft.services.messageToupper.WSClient.main(WSClient.java:60)

  • Wrong Case or ClassCastException

    Hello everyone
    I use JWSDP2.0, JDK is jdk1.5.0_12
    I have tried to generate class by the command:
    xjc -p test.jaxb poll.xsd
    Following is the schema
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xsd:element name="Poll" type="Poll"/>
         <xsd:complexType name="Poll">
              <xsd:sequence>
                   <xsd:element name="queryName" type="xsd:string"/>
                   <xsd:element name="params" type="QueryParams"/>
              </xsd:sequence>
              <xsd:anyAttribute processContents="lax"/>
         </xsd:complexType>
         <xsd:complexType name="QueryParams">
              <xsd:sequence>
                   <xsd:element name="param" type="QueryParam" minOccurs="0" maxOccurs="unbounded"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="QueryParam">
              <xsd:sequence>
                   <xsd:element name="name" type="xsd:string"/>
                   <!-- See note in EPCIS spec text regarding the value for this element -->
                   <xsd:element name="value" type="xsd:anyType"/>
              </xsd:sequence>
         </xsd:complexType>     
    </xsd:schema>I modify the poll.java, and add @XmlRootElement in front of the class declaration.
    Then I write code to test marshall and unmarshall
    package test;
    import java.util.List;
    import java.io.*;
    import javax.xml.bind.*;
    import org.w3c.dom.*;
    import test.jaxb.*;
    public class JAXBTest {
         public static void main(String[] args){
              try {
                   JAXBContext context = JAXBContext.newInstance("test.jaxb");
                   ObjectFactory factory = new ObjectFactory();
                   Marshaller marshal = context.createMarshaller();
                   marshal.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
                   Unmarshaller unmarshal = context.createUnmarshaller();
                   Poll poll = factory.createPoll();
                   poll.setQueryName("Query1");
                   QueryParams params = factory.createQueryParams();
                   List list = params.getParam();
                   QueryParam param = factory.createQueryParam();               
                   param.setName("Name");
                   param.setValue("David");
                   list.add(param);
                   poll.setParams(params);
                  OutputStream os = new FileOutputStream( "poll.xml" );
                  marshal.marshal( poll, os );     
                  marshal.marshal(poll,System.out);
                  Poll input = (Poll)unmarshal.unmarshal( new File( "poll.xml" ) );
                  System.out.println(input.getQueryName());
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }I found the root element is generated to "poll", not the schema defined "Poll"
    But marshall and unmarshall are ok.
    In order to comform the schema, I modify Poll.java again.
    Change @XmlRootElement to @XmlRootElement(name = "Poll")The result is I can generate the right case element now("Poll").
    But I get the exception simultaneously, unmarshall is not ok
    java.lang.ClassCastException: javax.xml.bind.JAXBElement
         at test.JAXBTest.main(JAXBTest.java:29)
    is there any resolution to solve wrong case problem and make marshall/unmarshall ok?
    Message was edited by:
    chihwen

    Hi,
    As far as I know Oracle are porting Developer R6 to Linux.
    We're also anxiously waiting for it to be out.
    It should be out in 2 or 3 months.
    About CASE I don't thing anyone will port it to linux.
    Regards,
    Michael
    Jose Abelardo Gutierrez (guest) wrote:
    : My company is looking for CASE or RAD tools for database system
    : developement on Linux.
    : If I can find something that suits our needs we will change all
    : our application developement schema to Linux, and I'll very
    : happy, and our client to.
    : Thanks for your reading
    null

  • ClassCastException - want using JXPATH

    Hi there,
    i've libraries i want to use which are using jxpath; the default oracle xml parser doesn't recognize the
    InputStream is =
    ServiceLocator.instance().getResourceLoader().getResourceAsStream(
    configFile);
    Reader reader = new InputStreamReader(is);
    Document doc = DOMHelpers.instance().newDocument(reader);
    Node root = doc.getFirstChild();
    --> For unknown reasons i get NULL! for following:
    final String jcdAlias =
    DOMHelpers.instance().selectSingleValue(
    root, "param[@name='jcdAlias']/@value");
    --> DOMHelpers:
    public Node selectSingleNode(Node aNode, String aXPathExpression) {
    Object obj = this.selectSingleObject(aNode, aXPathExpression);
    if ((obj != null) && !(obj instanceof Node)) {
    LOGGER.warn(
    MessageFormat.format(
    "Keine Node Instanz {0}, {1}",
    new Object[] {obj.getClass(), obj}));
    return null;
    return (Node)obj;
    public String selectSingleValue(Node aNode, String aXPathExpression) {
    Object val = this.selectSingleObject(aNode, aXPathExpression);
    if (val == null) {
    return null;
    return extractText(val);
    In TOMCAT 5.0x this works fine with JXPATH.
    I've configurated the orion-web.xml with following values:
    <classpath
    path="../../../applications/isgsn/my_Server/WEB-INF/classes"
    />
    <classpath
    path="../../../applications/isgsn/my_Server/WEB-INF/lib"
    />
    in /classes i've the commons-jxpath.jar...
    or
    <web-app-class-loader search-local-classes-first="true" />
    both results in:
    Caused by: java.lang.ClassCastException
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
    at de.x.helpers.DOMHelpers.<init>(Unknown Source)
    -->
    * standard constructor (private; Singleton)
    private DOMHelpers() {
    documentBuilderFactory = DocumentBuilderFactory.newInstance();
    documentBuilderFactory.setNamespaceAware(true);
    documentBuilderFactory.setValidating(false);
    does anyone has suggestions? i'm very tired searching for classpath settings :(
    thanks.

    thanx mate for the reply,
    i am sure that i am storing the same object in the vector.
    first of all I tried the same code by writing small class same as yours & it worked fine so i implemented in my real implementation class. But it still gives me classCastException i am not able to understand it why???? Actually my Product class is a stateless session bean(hope u know EJB)
    so actually i am storing a remote reference i.e(product)in my vector.But i dont think this should be a problem...
    please help....
    regards,
    ashish

  • ClassCastException at OAKeyFlexHelper.CreateFlex Error

    Hi,
    <br>
    When iam trying to call KeyFlexField.. Iam getting this error...Can anyone look into this please...
    <br><br><br><br>
    oracle.apps.fnd.framework.OAException: java.lang.ClassCastException: java.lang.String <br>
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
         <br>at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
         <br>at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2381)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         <br>at oa_html._OA._jspService(_OA.java:85)
         <br>at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         <br>at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         <br>at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         <br>at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         <br>at oracle.jsp.JspServlet.service(JspServlet.java:156)
         <br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         <br>at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         <br>at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         <br>at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.lang.ClassCastException: java.lang.String
         <br>at oracle.apps.fnd.framework.webui.OAKeyFlexHelper.createFlex(OAKeyFlexHelper.java:1054)
         <br>at oracle.apps.fnd.framework.webui.OAKeyFlexHelper.processFlex(OAKeyFlexHelper.java:756)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanFlexHelper.mergeSegmentsWithParent(OAWebBeanFlexHelper.java:303)
         <br>at oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean.mergeSegmentsWithParent(OAKeyFlexBean.java:87)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanBaseTableHelper.prepareFlexColumns(OAWebBeanBaseTableHelper.java:327)
         <br>at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.processRequestAfterController(OAAdvancedTableHelper.java:606)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:645)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanTableHelper.processRequest(OAWebBeanTableHelper.java:2084)
         <br>at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.processRequest(OAAdvancedTableHelper.java:569)
         <br>at oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean.processRequest(OAAdvancedTableBean.java:732)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
         <br>at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2335)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         <br>at oa_html._OA._jspService(_OA.java:85)
         <br>at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         <br>at oracle.jsp.app.JspApplication.dispatchRequest(JspApplic<br>ation.java:417)
         <br>at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         <br>at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         <br>at oracle.jsp.JspServlet.service(JspServlet.java:156)
         <br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         <br>at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         <br>at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         <br>at java.lang.Thread.run(Thread.java:595)
    java.lang.ClassCastException: java.lang.String
         <br>at oracle.apps.fnd.framework.webui.OAKeyFlexHelper.createFlex(OAKeyFlexHelper.java:1054)
         <br>at oracle.apps.fnd.framework.webui.OAKeyFlexHelper.processFlex(OAKeyFlexHelper.java:756)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanFlexHelper.mergeSegmentsWithParent(OAWebBeanFlexHelper.java:303)
         <br>at oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean.mergeSegmentsWithParent(OAKeyFlexBean.java:87)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanBaseTableHelper.prepareFlexColumns(OAWebBeanBaseTableHelper.java:327)
         <br>at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.processRequestAfterController(OAAdvancedTableHelper.java:606)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:645)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanTableHelper.processRequest(OAWebBeanTableHelper.java:2084)
         <br>at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.processRequest(OAAdvancedTableHelper.java:569)
         <br>at oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean.processRequest(OAAdvancedTableBean.java:732)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
         <br>at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
         <br>at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         <br>at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2335)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         <br>at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         <br>at oa_html._OA._jspService(_OA.java:85)
         <br>at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         <br>at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         <br>at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         <br>at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         <br>at oracle.jsp.JspServlet.service(JspServlet.java:156)
         <br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         <br>at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         <br>at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         <br>at java.lang.Thread.run(Thread.java:595)

    Soujanya,
    This should definately work as http session is common for both jsp and oaf page. I am not sure how r u playing with session in ur code. The other idea is to pass as url param and correpondingly use:
    pageContext.getParameter();
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Why my cutomize role mapper throws java.lang.ClassCastException: $Proxy67

    Hello all,
    I customize the role mapper as follows is my MDF content
    &lt;MBeanType
    Name = "TestRoleMapper"
    DisplayName = "TestRoleMapper"
    Package = "test.pkg.roles"
    Extends = "weblogic.management.security.authorization.RoleMapper"
    Implements = "weblogic.management.security.authorization.RoleReader"
    PersistPolicy = "OnUpdate"
    I implements the method "listRolesForResource", this method declared to return a string array.
    When I return the role name array then Weblogic throws java.lang.ClassCastException: $Proxy67
    Error snapshot
    http://antonov0318.googlepages.com/error.jpg
    Would I miss some interface ?
    Would somebody know how to solve it?
    Please let me know , Please....Thank you very much.
    Edited by: user6273860 on 2008/10/25 上午 12:00

    It looks like you're just taking random methods,
    calling them incorrectly, and expecting them to
    work.
    What do you think this will do?
         * Construct {@link java.lang.Object} array of keys from {@link java.util.Hashtable}
         * @param h {@link java.util.Hashtable}
         * @return array {@link java.lang.String}
         * @throws java.lang.IndexOutOfBoundsException Exception thrown if initial {@link java.lang.Object} array paramater cannot be indexed
        public static Object[] arrayKeys(Hashtable<Object, Object> h) throws IndexOutOfBoundsException {
            return h.keySet().toArray();
        }>
    ArrayFunctionality.arrayKeys(attrs)(new
    String[attrs.size()]);What's arrayKeys? And what do you think
    method(args) (some other stuff) ; will
    do?
    Somebody else showed you what to do earlier, but they
    had a typo. You need to pass an array of the
    appropriate type to toArray:
    String[] stringArr =
    (String[])theList.toArray(someStringArray);Read the docs for that method so you understand how
    it works. Just just blindly copy/paste.The API docs for toArray() for java.util.Set interface takes no parameters, I can't expect to know you can override it

  • ClassCastexception when casting a Class that extends HttpServletRequestWrap

    I have inherited some code that runs OK in JDK 1.4.2 in a JSP, but give s an exception when the JSP runs unfer 1.5.0. My Class is a as follows:
    public class WrappedRequest extends HttpServletRequestWrapper {
         public WrappedRequest(HttpServletRequest req) {
              super(req);     
         /** Return value string of requested parameter.
         * <ul>
         * <li> If htmlEncode == NO_HTML_ENCODE, return the native request param, un-html encoded
         * <li> If htmlEncode == HTML_ENCODE, return an html encoded copy of the requested parameter
         * <li> If htmlEncode is neither, return the html encoded copy of the requested parameter     
         * </ul>
         * @param     name               name of the request parameter
         * @param     htmlEncode          whether html encoded/un-encoded parameter value should be returned.
         * @return     String of the requested parameter value. If parameter name is null, return null
         public String getParameter(String name, int htmlEncode) {
              if(name != null && (htmlEncode == NO_HTML_ENCODE)) {
                   String str = super.getParameter(name);
                   return str;
              else
                   return getParameter(name);     
         public String getParameter(String name) {
              String str = super.getParameter(name);
              if(str != null)
                   str = Utils.htmlEncode(str); //Another package class
              return str;               
    This class in normally invoked as follows:
         String changeApproval = ((WrappedRequest)request).getParameter("CrApp" , WrappedRequest.NO_HTML_ENCODE);
    I get a ClassCastException exception on this line. Any suggestions?
    Regards,

    Stuart_Millington wrote:
    Further to my original post I have another question. Please bear in mind that I am fairly new to Java and this is code that I have inherited. In the following line of code (which is the line that causes the exception:
    String changeApproval = ((WrappedRequest)request).getParameter("CrApp" , WrappedRequest.NO_HTML_ENCODE);
    Why is the request being cast? The following code SEEMS to run OK:
    WrappedRequest wr = new WrappedRequest(request);
    String CrApproval = wr.getParameter("CrApp" , WrappedRequest.NO_HTML_ENCODE);
    Any ideas?
    Regards,
    Stuart MillingtonOkay, then I understand your problem.
    You can only cast request to WrappedRequest when request IS A WrappedRequest - ie the statement request = new WrappedRequest(request) was called. You are apparently trying to convert a default implementation of HttpServletRequest into a WrappedRequest without first 'Wrapping' the request.
    What does Wrapping a Request mean and do? A request object is generated by the servlet container and it isn't easy to switch in your own implementation. So instead you make a WrappedRequest which takes the original instance of the HttpServletRequest generated from by the container and adds functionality to it. A WrappedRequest would have to extend an HttpServletRequest, and implement all the public API of said parent class. Most of the time the methods would look something like this:
    public String getParameter(String key) { return this.parentRequest.getParameter(key); } That is, it simply delegates most of the work to the HttpServletRequest it is wrapping. But some functions it may want to change behavior for and for those you insert your implementation.
    What you need to do:
    1) Learn how to use Java before you touch Servlets and server side stuff. You are adding too much complication by going straight to the end game. Use a book and the tutorials to get you through.
    2) Take the time to run the JavaEE tutorial.
    3) Start with your own code. Taking code snippets you see around the net and trying to get them to work is tough when you don't understand the concepts. For example, using a WrappedRequest is normally fairly useless if it isn't implemented using a Filter, and they work the best when they don't require a change to the request interface (i.e. when you never actually have to do a cast). Since you don't know Filters, and don't yet understand how the wrapper works I would suggest not using them.
    This is probably a mis-use of the RequestWrapper idea anyway (since, like I said, it requires a change in interface). What you would be better off doing is simply choosing to pass the parameter through a utility function that does the encoding for you. Example like:
    String changeApproval = HTMLEncoder.encode(request.getParameter("CrApp");when you want the parameter encoded and
    String changeApproval = request.getParameter("CrApp");when you don't.
    If you don't want to make your own utility for this purpose (and why would you) you can download a library that does it for you. One example is the [org.apache.commons.lang.StringEscapeUtils#escapeXML|http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringEscapeUtils.html#escapeXml(java.lang.String)] class#method from the Apache Foundation. The StringEscapeUtils is part of the Apache Commons Lang project, which you can reach [At the Commons/lang website.|http://commons.apache.org/lang/]

Maybe you are looking for