ClassCastException when using Xalan-j in a servlet

Hi,
New to XSLT and Xalan...
When I run a standalone version of a basic XSL transformation using Xalan-j 2.6.0, it all works as desired. Take a look at the following code snippet :
ByteArrayOutputStream out;
Document document;
DocumentBuilder builder;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
File stylesheet = new File(context.getRealPath("/xml/duties2Email.xsl"));
File datafile = new File(context.getRealPath("/xml/hospitals.xml"));
StreamResult result;
StreamSource stylesource;
StreamSource datasource;
String date = (new SimpleDateFormat("dd/MM")).format(new Date());
Transformer transformer;
TransformerFactory tFactory;
out = new ByteArrayOutputStream(500);
builder = factory.newDocumentBuilder();
tFactory = TransformerFactory.newInstance();
stylesource = new StreamSource(stylesheet);
transformer = tFactory.newTransformer(stylesource);
datasource = new StreamSource(datafile);
result = new StreamResult(out);
transformer.setParameter("date", date);
transformer.transform(datasource, result);Unfortunately, when I try to run a servlet with exactly the same code, it throws a ClassCastException, please view the following stack trace:
java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault
at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:135)
at org.apache.xpath.XPathContext.<init>(XPathContext.java:87)
at org.apache.xalan.transformer.TransformerImpl.<init>(TransformerImpl.java:370)
at org.apache.xalan.templates.StylesheetRoot.newTransformer(StylesheetRoot.java:159)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:674)
at lu.etat.protex.duties.servlet.DutiesControllerServlet.sendEmails(Unknown Source)
at lu.etat.protex.duties.servlet.DutiesControllerServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
Does anybody know where the mistake could come from ?
Thanks in advance,
R&eacute;gis Kuckaertz

Turned out that I had a version of xsltc.jar in my WEB-INF/lib. When I removed it the problem went away.So I'm sure it had to do with a library mismatch. I am using JBoss 4.1.
-Rich

Similar Messages

  • ClassCastException when using OlapiPoolConnDriver

    Hi,
    I was following the instructions of the connection pool sample given in file
    sh_olap/bibeans/connectionpool/connectionPool.html
    in the samples.
    Everything is fine, the connection is fetched from the OlapiPoolConnDriver class.
    But then, when my presentation on the JSP tries to issue the OLAP query, I get the following exception below. It seems that MDMConnectionDriverImpl_92 tries to cast
    the connection to something (maybe OracleConnection), but when using the
    connection pool the connection is actually of type com.evermind.sql.DriverManagerConnectionPoolConnection.
    Any help would be appreciated.
    Thanks a lot
    Kai-Uwe
    07/08/01 20:34:57 java.lang.ClassCastException: com.evermind.sql.DriverManagerConnectionPoolConnection
    07/08/01 20:34:57      at oracle.dss.connection.server.drivers.mdm._92.MDMConnectionDriverImpl_92.connect(MDMConnectionDriverImpl_92.java:139)
    07/08/01 20:34:57      at oracle.dss.connection.server.drivers.mdm._92.MDMConnectionDriverImpl_92.connect(MDMConnectionDriverImpl_92.java:105)
    07/08/01 20:34:57      at oracle.dss.connection.server.drivers.mdm.MDMConnectionDriverImpl.connect(MDMConnectionDriverImpl.java:68)
    07/08/01 20:34:57      at oracle.dss.connection.server.ConnectionImpl.connect(ConnectionImpl.java:285)
    07/08/01 20:34:57      at oracle.dss.connection.client.Connection.connect(Connection.java:499)
    07/08/01 20:34:57      at oracle.dss.connection.client.Connection.connect(Connection.java:416)
    07/08/01 20:34:57      at oracle.dss.metadataManager.client.MetadataManager.setConnectionObjects(MetadataManager.java:4235)
    07/08/01 20:34:57      at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:924)
    07/08/01 20:34:57      at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:840)
    07/08/01 20:34:57      at oracle.dss.datautil.client.XMLManagerFactory.createQueryManager(XMLManagerFactory.java:196)
    07/08/01 20:34:57      at oracle.dss.datautil.client.ManagerFactoryImpl.lookupQueryManager(ManagerFactoryImpl.java:178)
    07/08/01 20:34:57      at oracle.dss.datautil.client.ManagerFactoryImpl.lookupMetadataManager(ManagerFactoryImpl.java:221)
    07/08/01 20:34:57      at oracle.dss.datautil.client.ManagerFactoryImpl.lookupManager(ManagerFactoryImpl.java:128)
    07/08/01 20:34:57      at oracle.dss.addins.thin.common.BaseThinSession.getMetadataManager(BaseThinSession.java:217)
    07/08/01 20:34:57      at oracle.dss.addins.thin.common.BaseThinSession.getQueryManager(BaseThinSession.java:253)
    07/08/01 20:34:57      at oracle.dss.addins.jspTags.TagRequestHandler.getStateManager(TagRequestHandler.java:781)
    07/08/01 20:34:57      at oracle.dss.addins.jspTags.BIThinSession.getStateManager(BIThinSession.java:61)
    07/08/01 20:34:57      at oracle.dss.addins.thin.common.BasePresentationHandler.createBIThinObject(BasePresentationHandler.java:296)
    07/08/01 20:34:57      at oracle.dss.addins.jspTags.PresentationTag.createThinObject(PresentationTag.java:234)
    07/08/01 20:34:57      at oracle.dss.addins.jspTags.BIBaseTag.getThinObject(BIBaseTag.java:79)
    07/08/01 20:34:57      at oracle.dss.addins.jspTags.PresentationTag.doStartTag(PresentationTag.java:258)
    07/08/01 20:34:57      at secondpage.jspService(secondpage.jsp:10)
    07/08/01 20:34:57      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    07/08/01 20:34:57      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
    07/08/01 20:34:58      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
    07/08/01 20:34:58      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
    07/08/01 20:34:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/08/01 20:34:58      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    07/08/01 20:34:58      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:229)
    07/08/01 20:34:58      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    07/08/01 20:34:58      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
    07/08/01 20:34:58      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    07/08/01 20:34:58      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    07/08/01 20:34:58      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    07/08/01 20:34:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    07/08/01 20:34:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/08/01 20:34:58      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    07/08/01 20:34:58      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:229)
    07/08/01 20:34:58      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    07/08/01 20:34:58      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
    07/08/01 20:34:58      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    07/08/01 20:34:58      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    07/08/01 20:34:58      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    07/08/01 20:34:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    07/08/01 20:34:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    07/08/01 20:34:58      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    07/08/01 20:34:58      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
    07/08/01 20:34:58      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    07/08/01 20:34:58      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    07/08/01 20:34:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    07/08/01 20:34:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    07/08/01 20:34:58      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    07/08/01 20:34:58      at java.lang.Thread.run(Thread.java:534)
    07/08/01 21:11:22 java.lang.ClassCastException: com.evermind.sql.DriverManagerConnectionPoolConnection
    07/08/01 21:11:22      at oracle.dss.connection.server.drivers.mdm._92.MDMConnectionDriverImpl_92.connect(MDMConnectionDriverImpl_92.java:139)
    07/08/01 21:11:22      at oracle.dss.connection.server.drivers.mdm._92.MDMConnectionDriverImpl_92.connect(MDMConnectionDriverImpl_92.java:105)
    07/08/01 21:11:22      at oracle.dss.connection.server.drivers.mdm.MDMConnectionDriverImpl.connect(MDMConnectionDriverImpl.java:68)
    07/08/01 21:11:22      at oracle.dss.connection.server.ConnectionImpl.connect(ConnectionImpl.java:285)
    07/08/01 21:11:22      at oracle.dss.connection.client.Connection.connect(Connection.java:499)
    07/08/01 21:11:22      at oracle.dss.connection.client.Connection.connect(Connection.java:416)
    07/08/01 21:11:22      at oracle.dss.metadataManager.client.MetadataManager.setConnectionObjects(MetadataManager.java:4235)
    07/08/01 21:11:22      at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:924)
    07/08/01 21:11:22      at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:840)
    07/08/01 21:11:22      at oracle.dss.datautil.client.XMLManagerFactory.createQueryManager(XMLManagerFactory.java:196)
    07/08/01 21:11:22      at oracle.dss.datautil.client.ManagerFactoryImpl.lookupQueryManager(ManagerFactoryImpl.java:178)
    07/08/01 21:11:22      at oracle.dss.datautil.client.ManagerFactoryImpl.lookupMetadataManager(ManagerFactoryImpl.java:221)
    07/08/01 21:11:22      at oracle.dss.datautil.client.ManagerFactoryImpl.lookupManager(ManagerFactoryImpl.java:128)
    07/08/01 21:11:22      at oracle.dss.addins.thin.common.BaseThinSession.getMetadataManager(BaseThinSession.java:217)
    07/08/01 21:11:22      at oracle.dss.addins.thin.common.BaseThinSession.cleanup(BaseThinSession.java:350)
    07/08/01 21:11:22      at oracle.dss.addins.thin.common.BaseThinSession.valueUnbound(BaseThinSession.java:201)
    07/08/01 21:11:22      at com.evermind.server.http.EvermindHttpSession.destroy(EvermindHttpSession.java:312)
    07/08/01 21:11:22      at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:263)
    07/08/01 21:11:22      at com.evermind.server.http.SessionAsyncInvalidateHandler.invalidateSession(SessionAsyncInvalidateHandler.java:173)
    07/08/01 21:11:22      at com.evermind.server.http.SessionAsyncInvalidateHandler.run(SessionAsyncInvalidateHandler.java:133)
    07/08/01 21:11:22      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    07/08/01 21:11:22      at java.lang.Thread.run(Thread.java:534)

    Hi, this one's solved.
    It was my mistake, I accidentally referred to the jdbc/OLAPConnection1PooledDS
    insted of the jdbc/OLAPConnection1CoreDS. This is why I got the evermind..blbla.
    connection.
    Mea culpa ... mea culpa ... mea maxima culpa
    Hang on and thanks to all who had a look at it.
    Kai-Uwe

  • ClassCastException when using javax.xml.soap.DetailEntry

    I am using the Java Web Services development pack and I'm getting a ClassCastException when trying to use a DetailEntry object.
    My code is basically as follows:
    SOAPFault fault = responseSoapBody.getFault();
    Detail detail = fault.getDetail();
    Iterator iterator = detail.getDetailEntries();
    DetailEntry entry = (DetailEntry)iterator.next(); //exception!!
    Exception:
    java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.dom4j.TextImpl
    The object being returned from the Iterator seems to be a TextImpl. In my CLASSPATH are the jars in the lib directory under <JWSDP>\jwsdp-1_0_01\common\lib.
    Any idea why I'm getting this Exception? Is this a bug in the JWSDP, or in my code?
    Thanks...

    You post has been forwarded to the SAAJ person as it seems
    like a SAAJ exception ... u should be hearing from the
    individual soon
    asengup

  • ClassCastException when using ADFBindingFilter

    Hi,
    I have mixed JSF/ADFBC and JSP/UIX/BC4J application. When I first enter some non-jsf page, the page is rendered correctly, but on the bottom there is an exception:
    java.lang.ClassCastException: oracle.adf.share.DefaultContext
         at oracle.adf.share.http.ServletADFContext.resetThreadContext(ServletADFContext.java:283)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:346)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at sk.transacty.logger.DebugLoggerFilter.doFilter(DebugLoggerFilter.java:158)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)It appears only on first request in session and seems not to cause any problem, except for the message. Does anyone know how to get rid of it?
    Thanks, Viliam

    Some pages use <jbo:> tags, some use pagedefs etc. When the DataControls.cpx file is not in a package, I can reference it with <jbo:ApplicationModule> tag.
    I know it's not designed for this, but we cannot just rewrite whole app and we want to use new technologies... Maybe anyone else has same problem and has a solution...
    Viliam

  • ClassCastException when using DefaultTableModel.getValueAt to get data

    Hi,
    I'm using JTable to display,add and edit customers informantion in my project, the properties of each customer is displayed in corresponding cloumns in one row. The properies consist of id(Integer), name(String)...etc, it works fine when I set and get the properties of existing customer information into the DefaultJTableModel(dm for short) of the table I created, but when I added the new row using dm.addRow() and get the information typed in manually, an exception of ClassCastException was raised
    here is the way I created JTable columns,and added a new row
    DefaultJTableModel md =(DefaultJTableModel ) this.jTable.getModel();
    md.addColumn("ID");
    md.addColumn("Name");
    md.addRow(new Object[]{
    Integer.valueOf("1"),
    "A"
    } )then I captured mousecliked event of an Add button to add a new row in the table as bellow
    md.addRow(new Object[]{null}) // as there's no need to initialize each column of each new row ,i used null instead of new Object[]{default id, default name};after editing the new row added to the table I captured the mouse cliked event of an Save button to save the added row which I wanted to write back to an bean
    Customer c=new Customer()
    c.setId((Integer)md.getValueAt(0,0));
    c.setName((String)md.getValueAt(0,1));
    c=new Customer()
    c.setId((Integer)md.getValueAt(1,0)); // here is the point which caused the ClassCastExcption happened
    c.setName((String)md.getValueAt(1,1));the exception message is
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    It seems the newRow() method set all the columns of a new row to the type of String,
    my question is how can I set the data type of a column in the table?

    When you edit a table cell, JTable writes your edit back into the model. Most of the time, editing means entering text, so obviously, JTable will write a String into your model. JTable might be able to handle simple conversions such as String to Integer, but at the very least you would have to tell the table that you want only Integers in your column by implementing [TableModel.getColumnClass|http://java.sun.com/javase/6/docs/api/javax/swing/table/TableModel.html#getColumnClass(int)] appropriately. I honestly don't remember if the table can do this, though. If it can't, you probably need to either use a custom editor that converts the user entered text into an appropriate object or you need to use a custom model that handles the conversion in its setValue method.

  • ClassCastException when using IXC

    Has anyone run into this problem? I'm exporting an object using the IxcRegistry operation. Another Xlet is obtaining a handle to that object using IxcRegistry.lookup. I am able to call methods that the object implements however when returning a value, other than a standard java object (meaning, something I've created) it will give me a ClassCastException.

    I assume you're defining a remote method M, and M's return type is an object that you've defined ("something I've created", in your statement). Invoking M through the handle is causing you ClassCastException.
    IXC can only take primitives, Remote objects, and Serializable objects for the parameter type and return type of the remote methods. Could it be that an java object you've defined does not implement either java.rmi.Remote or java.io.Serializable?

  • ClassCastException when using formsgraph.jar

    We are using Bean areas using oracle.forms.demos.bigraph.FormsGraph as the Implementation Class. But we get this excpetion always.
    java.lang.ClassCastException: java.lang.Boolean
         at oracle.forms.demos.bigraph.FormsGraph.setProperty(FormsGraph.java:1824)
         at oracle.forms.handler.ComponentItem.setCustomProperty(Unknown Source)
         at oracle.forms.handler.ComponentItem.onUpdate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onUpdate(Unknown Source)
         at oracle.forms.handler.UICommon.onUpdate(Unknown Source)
         at oracle.forms.engine.Runform.onUpdateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Any ideas?

    We are using Bean areas using oracle.forms.demos.bigraph.FormsGraph as the Implementation Class. But we get this excpetion always.
    java.lang.ClassCastException: java.lang.Boolean
         at oracle.forms.demos.bigraph.FormsGraph.setProperty(FormsGraph.java:1824)
         at oracle.forms.handler.ComponentItem.setCustomProperty(Unknown Source)
         at oracle.forms.handler.ComponentItem.onUpdate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onUpdate(Unknown Source)
         at oracle.forms.handler.UICommon.onUpdate(Unknown Source)
         at oracle.forms.engine.Runform.onUpdateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Any ideas?

  • Invalid Content-Type value on OC4J 10.1.3.4.0 when using JAX-WS

    Hi all,
    I'm developing web services using JAX-WS on top of OC4J 10.1.3.4.0. I followed the procedure to enable this in the developer guide with success. My web service is running fine but the headers of the HTTP response contains an invalid value for the Content-Type header
    The charset element has the value utf-8" (with the double quote included) which is interpreted as a wrong encoding by the client application.<br />
    Below is the HTTP request and response with the error. (I stripped the soap part for clarity)<br />
    <br />
    POST /mywebservice/ HTTP/1.1<br />
    Content-Type: text/xml;charset=UTF-8<br />
    SOAPAction: "http://soap.exemple.com/mywebservice"<br />
    User-Agent: Jakarta Commons-HttpClient/3.0.1<br />
    Host: behs0054:8888<br />
    Content-Length: 2174<br />
    <br />
    &lt;...&gt; soap message<br />
    <hr />
    HTTP/1.1 500 Internal Server Error<br />
    Date: Fri, 03 Oct 2008 13:10:43 GMT<br />
    Server: Oracle Containers for J2EE<br />
    Connection: Keep-Alive<br />
    Keep-Alive: timeout=15, max=100<br />
    Content-Type: text/xml;charset=<strong>utf-8"
    </strong>Transfer-Encoding: chunked
    &lt;...&gt; soap fault received
    <hr />
    Thanks a lot for your answers,
    Gauthier

    Does not only happen when using JAX-WS.
    the following servlet code is enough to reproduce the problem :
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/xml;charset=\"utf-8\"");
    It only occurs on 10.1.3.4.0 (works fine on 10.1.3.3.0 and 11.1.1.1.0 TP4)
    Regards

  • Invalid SOAP action when using java ws WebService

    Hi all,
    this is a slightly more detailed error for a problem i posted recently. I am connecting to a web service that was generated from WSDL. It has two methods "HelloWorld" and "HelloSayFirstName". As defined in the WSDL, the methods use the SOAP action document style. I want to add a cookie to the http header, so after the port is created, I use the following to add the header to the requestContext:
              BindingProvider bindingProvider = (BindingProvider) servicePort;
              Map<String, Object> requestContext = bindingProvider.getRequestContext();
              List<String> cookies = new ArrayList<String>();
              cookies.add("mycookie=mytoken");
              HashMap<String, List<String>> httpHeaders = new HashMap<String, List<String>>();
              httpHeaders.put(HTTPConstants.HEADER_COOKIE, cookies);
              requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
    This works when I call the first method (HelloWorld) - the first activity message sent to the server contains the following:
    <HttpRequest>
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Cache-Control>no-cache</Cache-Control>
    <Connection>keep-alive</Connection>
    <Pragma>no-cache</Pragma>
    <Transfer-Encoding>chunked</Transfer-Encoding>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Accept>*</Accept>
    <Cookie>mycookie=mytoken</Cookie>
    <Host>exampleHost</Host>
    <User-Agent>Java/1.5.0_14</User-Agent>
    <SOAPAction>"http://tempuri.org/IMyService/HelloWorld"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://exampleHost/WebServices/WCFService/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/HelloWorld</Action>
    </s:Header>
    <soap:Body>
    <HelloWorld xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
    <myValue1>world</myValue1>
    </HelloWorld>
    </soap:Body>
    </soap:Envelope>
    However, after this method, the httpHeaders in the requestContext object have been updated to include the "Accept" header and the "SOAPAction" header - which is the incorrect action! Now, when I call the method "HelloSayFirstName" I get the following:
    <HttpRequest>
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Cache-Control>no-cache</Cache-Control>
    <Connection>keep-alive</Connection>
    <Pragma>no-cache</Pragma>
    <Transfer-Encoding>chunked</Transfer-Encoding>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Accept>*</Accept>
    <Cookie>mycookie=mytoken</Cookie>
    <Host>exampleHost</Host>
    <User-Agent>Java/1.5.0_14</User-Agent>
    <SOAPAction>"http://tempuri.org/IMyService/HelloWorld"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://exampleHost/WebServices/WCFService/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/HelloWorld</Action>
    </s:Header>
    <soap:Body>
    <HelloSayFirstName xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
    <dataContractValue></dataContractValue>
    </HelloSayFirstName>
    </soap:Body>
    </soap:Envelope>
    It seems that the SOAPAction in the http header and the soap header is incorrect. Is there any reason why the requestContext would keep hold of the action that was previously called, and not use the new action? I'm stumped here - any help would be greatly appreciated.
    Cheers.

    Does not only happen when using JAX-WS.
    the following servlet code is enough to reproduce the problem :
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/xml;charset=\"utf-8\"");
    It only occurs on 10.1.3.4.0 (works fine on 10.1.3.3.0 and 11.1.1.1.0 TP4)
    Regards

  • ClassCastException When we use JSP with Normal Bean in WebLogic 5.1

              Hai Everybody...
              We have an application where JSP files are using the Normal Java beans(Nothing
              but a Java Class).Here all jave beans are in a folder ..\myserver\classfiles\
              and the jsp files are in ..\myserver\public_html\..... .
              This combination is throwing a ClassCastException when the JSP try to Intantiate
              the bean....It doesn't give error alway..Initially it works fine and all of a
              sudden it throws this error..
              Plse..If anybody can help us Do So....
              sijo
              

    That is correct; WLS 5.1 does not support the updating of these helper classes.
              In WLS 6.0, you can package everything up as a web application or enterprise
              application and redeploy the whole thing (including the helper classes)...
              Alex wrote:
              > But, Robert, that means the JavaBean classes cannot be updated without
              > restarting the server.
              >
              > I tried putting them in the servlet directory. With the result that they
              > often work, but sometimes I get the same ClassCastException as sijo. Where
              > should JavaBean classes that are used from JSP (and maybe other servlets) be
              > put in order to be able to update them?
              >
              > "Robert Patrick" <[email protected]> escribió en el mensaje
              > news:[email protected]...
              > > The Java Beans being used by the JSP pages need to be placed into the
              > > WEBLOGICCLASSPATH (i.e., -Dweblogic.class.path=...) and not in the working
              > directory
              > > where the JSP-generated classes are created (i.e., \myserver\classfiles is
              > typically
              > > the working directory for the JSPServlet and \myserver\serverclasses is
              > the
              > > appropriate place for the Java Beans used by the JSPs)...
              > >
              > > sijo wrote:
              > >
              > > > Hai Everybody...
              > > >
              > > > We have an application where JSP files are using the Normal Java
              > beans(Nothing
              > > > but a Java Class).Here all jave beans are in a folder
              > ..\myserver\classfiles\
              > > > and the jsp files are in ..\myserver\public_html\..... .
              > > >
              > > > This combination is throwing a ClassCastException when the JSP try to
              > Intantiate
              > > > the bean....It doesn't give error alway..Initially it works fine and all
              > of a
              > > > sudden it throws this error..
              > > >
              > > > Plse..If anybody can help us Do So....
              > > >
              > > > sijo
              > > >
              > > >
              > >
              

  • A problem when using Sun One to create a Servlet?

    I have the Sun One Application Server installed on my computer. I used the Sun One Studio to create my first Servlet: HelloServlet. The steps are as following:
    1)First, the filesystem I mounted on Sun One Studio is:
    D:\myProgram\John\JohnEJB1.
    2)Then I created a folder(or package) under it, it�s called client. I created a html file, hello.html under this client folder, which will call a servlet later. Immediately, I transferred this client folder to a Web Module. So there is a WEB-INF under the D:\myProgram\John\JohnEJB1 in the Sun One Studio. This WEB-INF of course has one classes folder and one lib folder.
    3) Under this classes folder, which is used to save all the Servlet classes, I put my HelloServlet.java.
    4) in the web.xml, I put the following:
    <servlet>
    <servlet-name>MyHello</servlet-name>
    <display-name>MyHello</display-name>
    <servlet-class>samServlet. HelloServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MyHello </servlet-name>
    <url-pattern>/samTest</url-pattern>
    </servlet-mapping>
    5) Again, in the html file hello.html mentioned earlier, I put the Action like this: <FORM METHOD="GET" ACTION="/samTest">
    6) Finally, I deployed this WEB-INF to the Sun One Application Server.
    But when I went to the url: http://localhost: 80/client/hello.html to test it, when I clicked the Form Button, in other words, when the html file called the Servlet, it failed. It reported some error like NoClassDefFoundError.
    Anyone who can point out which part was wrong here? I know it�s a very basic problem. So I really appreciate your help.

    The classes folder should contain class files, not java files.

  • Problem translating servlet name from an encoded URL when using HTTPS

    Hello:
    I am experiencing a wierd issue when using WLS 5.1 with HTTPS and am hoping someone might
    be able to shed some light...
    I have deployed a web application and am using HTTPS.
    So, a typical call to a servlet is
    https://foo.com/web_app_context/servlet_name/servlet_arguments
    The servlet is used to upload files from disk to a database and to also download the same.
    Therefore, the servlet_arguments string contains the file name among other things.
    The problem seems to arise when the file name contains either a space or an
    underscore e.g. "file_name" or "file name". It is then typically encoded as
    "file%20name" in
    the URL.
    So a call then looks like:
    https://foo.com/web_app_context/servlet_name/file%20name
    When this request is sent to WLS, it seems to truncate the servlet_name by a couple
    of characters causing the request to fail.
    This works fine using HTTP.
    Any thoughts would be much appreciated.
    Thanks in advance.
    Prashant

    The JNDI call is different when you call an EJB from inside the J2EE.
    ctx = new InitialContext();
    ref = ctx.lookup("java:comp/env/<JNDI-Name>");
    Regards
    Stefan

  • Weblogic.utils.NestedRuntimeException when using javax.servlet.Filter

    IDE: JDev 10gR3.4 & JDev 11gR2.3
    ViewController technology: JSF/ADF Faces
    Example code flow:
    Run page2.jsf
    MyFilter intercepts request, checks for parameter on session.
    If parameter not null, goto page2.jsf
    Else redirect to page1.jsf
    page1.jsf has a button that sets the value on the session scope after clicking.
    In jdev 11gR2.3, I get an weblogic.utils.NestedRuntimeException after clicking the button on page1.jsf. This error does not occur in jdev 10gR3.5. Although the application continues to execute and proper info is displayed, I’m wondering why this occurs and also if I should be concerned. Has anyone experienced a similar issue when using javax.servlet.Filter in 11g?
    MyFilter code snipet:
        public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) {
            try {
                HttpServletRequest httpRequest = (HttpServletRequest)servletRequest;
                HttpServletResponse httpResponse = (HttpServletResponse)servletResponse;
                String redirect = httpRequest.getContextPath() + "/faces/page1.jsf"; //only difference here is 11g uses jsf, 10g uses jsp.
                String uri = httpRequest.getRequestURI().toString();
                Boolean mySessionAttribute = (Boolean)httpRequest.getSession().getAttribute("MYSESSIONATTRIBUTE");
                if (uri.endsWith(redirect) || mySessionAttribute != null) {
                    filterChain.doFilter(servletRequest, servletResponse);
                } else {
                    httpResponse.sendRedirect(redirect);
                    return;
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ServletException e) {
                e.printStackTrace();
    page1.jsf/jsp
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
        <h:form id="f1">
            <h:commandButton value="Submit" id="cb1" action="#{Page1Bean.clicked}" type="submit"/>
        </h:form>
    </f:view>page2.jsf/jsp
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="main.jsf" id="d1">
            <af:form id="f1">
                <af:outputText value="This is the main content" id="ot1"/>
            </af:form>
        </af:document>
    </f:view>Page1Bean.java
    public class Page1Bean {
        public void clicked() {       
            FacesContext context = FacesContext.getCurrentInstance();
            ExternalContext externalContext = context.getExternalContext();
            externalContext.getSessionMap().put("MYSESSIONATTRIBUTE", Boolean.TRUE);
            try {
                externalContext.redirect("/11gFilterExample-ViewController-context-root/faces/page2.jsf");
            } catch (IOException e) {
                    e.printStackTrace();
    }Full exception
    weblogic.utils.NestedRuntimeException: Cannot parse POST parameters of request: '/11gFilterExample-ViewController-context-root/faces/page1.jsf'
         at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2144)
         at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:2024)
         at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.getQueryParams(ServletRequestImpl.java:1918)
         at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.getParameter(ServletRequestImpl.java:1995)
         at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.access$800(ServletRequestImpl.java:1817)
         at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:804)
         at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:169)
         at org.apache.myfaces.trinidadinternal.context.external.ServletRequestParameterMap.getAttribute(ServletRequestParameterMap.java:43)
         at org.apache.myfaces.trinidadinternal.context.external.ServletRequestParameterMap.getAttribute(ServletRequestParameterMap.java:31)
         at org.apache.myfaces.trinidadinternal.context.external.AbstractAttributeMap.get(AbstractAttributeMap.java:73)
         at oracle.adfinternal.controller.state.ControllerState.getRootViewPortFromRequest(ControllerState.java:788)
         at oracle.adfinternal.controller.state.AdfcContext.initialize(AdfcContext.java:185)
         at oracle.adfinternal.controller.state.AdfcContext.initialize(AdfcContext.java:79)
         at oracle.adfinternal.controller.application.AdfcConfigurator.beginRequest(AdfcConfigurator.java:53)
         at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._startConfiguratorServiceRequest(GlobalConfiguratorImpl.java:562)
         at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.beginRequest(GlobalConfiguratorImpl.java:212)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:174)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(SocketInputStream.java:168)
         at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:177)
         at weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:228)
         at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2118)
         ... 39 more
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled

    I dont believe that solution pertains to my case. clicked() is invoked from standard jsf page and the adf controller is not acquired yet. i put a couple of print statements in the filter and it seems that the doFilter is called twice! This is not the case when running in 10g.
                if (uri.endsWith(redirect) || mySessionAttribute != null) {
                    System.out.println("URI dofilter: "+uri);
                    filterChain.doFilter(servletRequest, servletResponse);
                } else {
                    System.out.println("URI sendRedirect: "+uri);
                    httpResponse.sendRedirect(redirect);              
                }11g weblogic console log:
    URI sendRedirect: /11gFilterExample-ViewController-context-root/faces/page2
    URI dofilter: /11gFilterExample-ViewController-context-root/faces/page1.jsf
    URI dofilter: /11gFilterExample-ViewController-context-root/faces/page1.jsf
    10g oc4j console log:
    13/01/07 15:48:13 URI sendRedirect: /10gFilterExample-ViewController-context-root/faces/page2.jsp
    13/01/07 15:48:13 URI dofilter: /10gFilterExample-ViewController-context-root/faces/page1.jsp
    I believe whatever thats causing this occur could be why the exception is thrown...

  • Java.lang.thread exception while using Xalan 2.0 in WLS 6.0

    Hi, I'm trying to use Xalan 2.0 in a servlet hosted by WLS. Ive
    modified Xalan's SimpleTransform sample to be a servlet. I
    create a Transformer with the .xsl, then call tranform() to
    print the tranformed xml to the response stream. The xml is
    tranformed correctly, but it throws a java.lang.thread
    exception. The standalone Xalan sample doesn't do this. Anyone
    else seen this problem?
    Here's the code of interestest, I apologize if its not formatted very well:
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
         PrintWriter out = res.getWriter();
         res.setContentType("text/html");
         out.println("<html><head><title>XalanTest<title></head>");
         out.println("<body><h1>XalanTest</h1>");
         try{
         TransformerFactory tFactory = TransformerFactory.newInstance();
         StreamSource ss = new StreamSource("file:\\\\My-path\\birds.xsl");
         Transformer transformer = tFactory.newTransformer(ss);
         StreamResult SR = new StreamResult(out);
         transformer.transform(new StreamSource("file:\\\\My-path\\birds.xml"), SR );
         catch(Exception e){
         out.println("<p>" + e.toString() + "</p>");
         e.printStackTrace(out);
         out.println("<p>Exception</p>");
              out.println("</body></html>");

    It also looks like the workaround suggested does not work.
    I put the following code as workaround:
         response.setContentType("text/html");
         response.setHeader ("Pragma", "no-cache");
         Transformer transformer;
         TransformerFactory factory = TransformerFactory.newInstance();
         String stylesheet = "config\\closs\\applications\\webroot\\jsp\\example\\Load2.xsl";
         String sourceId = "config\\closs\\applications\\webroot\\jsp\\example\\Load2.xml";
         String outputFile = "config\\closs\\applications\\webroot\\jsp\\example\\Load2.html";
         String outputDirectFile = "config\\closs\\applications\\webroot\\jsp\\example\\Load2_Direct.html";
         try
              PrintWriter fout = new PrintWriter (new FileOutputStream (outputFile));
              OutputStream os = new ByteArrayOutputStream();
              transformer = factory.newTransformer(new StreamSource(stylesheet));
              transformer.transform(new StreamSource(sourceId), new StreamResult(outputDirectFile));
              transformer.transform(new StreamSource(sourceId), new StreamResult(os));
              os.flush ();
              os.close();
              out.print(os.toString());
              fout.print (os.toString ());
              fout.flush ();
              fout.close ();
         catch (Exception e)
              // Error Handler
         e.printStackTrace();
    The two .html files produced look exactly the same, which is good.
    However, the screen output to my html browser (Internet Explorer 5.50 sp1) produces
    different output.
    That is strange, but that shows that this bug does not have a known workaround
    "Rabinowitz" <[email protected]> wrote:
    >
    I have the same problem with java sun xml parser (jaxp 1-1)
    It is interesting to know that all this perfectly works under weblogic
    5.1, so
    I cannot migrate my application to 6.0
    So, the functionality of weblogic 6.0 degraded since 5.1.
    I cannot buy the explanation that that is not bea's fault, because it
    perfectly
    worked with the same version of xml parser.
    Now, their customer support is saying they have not decided whether this
    is a
    bug or a feature.
    Interesting to know that degradation of functionality could be a feature!
    It is now June 21, 3 months since this bug was reported, sp2 was shipped
    since
    that time, and this bug is still there.
    "Chuck H. Zhao" <[email protected]> wrote:
    I am having the exact same problem you are having. If we analyze the
    stack
    trace:
    javax.xml.transform.TransformerException: java.lang.Thread
    at
    org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
    ava:1212)
    at
    org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
    at java.lang.Thread.run(Thread.java:484)
    java.lang.ClassCastException: java.lang.Thread
    at
    weblogic.servlet.internal.ResponseHeaders.setDateHeader(ResponseHeaders.java
    :273)
    at
    weblogic.servlet.internal.ServletResponseImpl.setDateHeader(ServletResponseI
    mpl.java:449)
    at
    weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseIm
    pl.java:637)
    at
    weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamI
    mpl.java:124)
    at
    weblogic.servlet.internal.WLOutputStreamWriter.flush(WLOutputStreamWriter.ja
    va:124)
    at java.io.PrintWriter.flush(PrintWriter.java:120)
    at
    org.apache.xalan.serialize.SerializerToXML.flushWriter(SerializerToXML.java:
    1431)
    at
    org.apache.xalan.serialize.SerializerToXML.endDocument(SerializerToXML.java:
    629)
    at
    org.apache.xalan.transformer.ResultTreeHandler.endDocument(ResultTreeHandler
    ..java:180)
    at
    org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
    ava:1194)
    at
    org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
    at java.lang.Thread.run(Thread.java:484)
    What happened is: to support incremental output, Xalan-Java performs
    the
    transformation in a second thread while building the source tree inthe
    main
    thread. So Transformer.transform() creates a new thread to run the
    transformer.run() method, which will write to weblogic's internal
    ServletOutputStreamImpl, and in the end calls flush() on it.
    ServletOutputStreamImpl determines that the headers haven't been written
    yet, and the headers need to be written before any servlet output, so
    it
    calls ServletResponseImpl.writeHeaders(), which eventually calls
    ResponseHeaders.setDateHeader(). The last method assumes the thread
    is
    weblogic's internal ExecuteThread and tries to cast the thread as such,
    maybe to get the date from it. But the thread is a plain java.lang.Thread
    created by xalan, thus we get the java.lang.ClassCastException:
    java.lang.Thread
    This suggests a second workaround: call ServletResponse.flushBuffer()
    before any xalan stuff, which will force the headers to be written in
    weblogic's ExecuteThread. The shortcoming of this is that this will
    cause
    the response to be commited, and if the xalan stuff throws exception
    you can
    not forward to another page.
    Another thing is that xalan should not directly call flush() on
    ServletOutputStreamImpl at all. I will report it to xalan and see if
    they
    consider that a bug. If they fix that then we have a third workaround:
    set
    the buffer size of ServletResponse big enough to accomodate everything
    including the xslt outputs, so the ServletOutput does not need to be
    flushed
    during xalan code.
    I do not consider this problem a weblogic bug, since the servlet container
    has to right to expect any thread inside it to be its own. Serlvet2.2
    spec
    says:
    1.2 What is a Servlet Container?
    A Servlet Container may place security restrictions on the environment
    that
    a servlet executes in. In
    a Java 2 Platform Standard Edition 1.2 (J2SE) or Java 2 Platform Enterprise
    Edition 1.2 (J2EE)
    environment, these restrictions should be placed using the permission
    architecture defined by Java 2
    Platform. For example, high end application servers may limit certain
    action, such as the creation of
    a Thread object, to insure that other components of the container are
    not
    negatively impacted.
    Weblogic should explicitly warn the developers that creating threads
    inside
    the servlet container may have adverse effects, the same kind of problem
    we
    are having. (or maybe they already did somewhere in their documentation?)
    On the xalan side, I would suggest them to either give the option to
    switch
    the two threads, or to give the option to buffer the output and write
    it out
    in the main thread, which is exactly what you did in your first workaround.
    Any comments or thoughts on the subject are welcome.
    -- Chuck Zhao
    "MK Parini" <[email protected]> wrote in message
    news:[email protected]...
    I found, what I think to be a bug, and a work-around for it.
    When doing an XSLT Transformation, you must specify a StreamResult
    to which to write the output. I was doing my transformation in
    a
    servlet so I was writing my output to the HttpResponse
    (The variable res is a javax.servlet.http.HttpServletResponse
    object)
    StreamResult htmlTarget = new StreamResult(res.getWriter());
    If I use this, when I perform the transformation using the TRAX
    APIs,
    InputStream xslFile = context.getResourceAsStream(fileName);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Templates xslTemplates = tFactory.newTemplates(new StreamSource(xslFile));
    transformer = xslTemplates.newTransformer();
    transformer.transform(xmlSource, htmlTarget);
    I receive the ClassCastException from the class
    weblogic.servlet.internal.ResponseHeaders.setDateHeader(ResponseHeaders.java
    :273),
    as seen in my previous posting.
    I discovered, if I write my output to a StringBuffer, and then
    I write
    the StringBuffer to the HttpResponse, I do not get the ClassCastException.
    For example,
    StringWriter myWriter = new StringWriter(2400);
    StreamResult htmlTarget = new StreamResult(myWriter);
    <Same transformation code as above>
    myWriter.close();
    PrintWriter out = res.getWriter();
    out.print(myWriter.toString());
    Is this a bug in the weblogic internal servlet class or am I just
    missing something?
    Also, one concern that I have with the workaround is that it might
    hurt performance.
    Any comments or thoughts on the subject are welcome.

  • Weblogic 9.2 error when using spring framework and taglibs.

    I am getting the following error when using spring binding for a command form class.
    Class ExCommandForm
    private String firmCode;
    public String getFirmCode ()
    public void setFirmCode ()
    In my jsp I have the following
    <spring:bind path="exCommandForm.firmCode">
    <input name="<c:out value="${status.expression}"/>" type="text" value="<c:out value="${status.value}"/>" >
    </spring:bind>
    Ps. exCommandForm is the commandForm declaration in my SiimpleFormController.
    When I deploy the application to weblogic 9.2 I get the following error :
    <Apr 26, 2007 4:34:44 PM BST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.int
    ernal.WebAppServletContext@1f601c6 - appName: 'BDRui', name: 'BDRui', context-pa
    th: '/BDRui'] Root cause of ServletException.
    java.lang.ClassCastException: javax.servlet.jsp.jstl.core.LoopTagSupport$1Status
    at jsp_servlet._web_45_inf._jsp.__tradesearch._jspService(__tradesearch.
    java:1075)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
    Ps. Deploying application on Tomcat 5.23 works.
    Can anyone help on this ?
    cheers in advance.
    More Info - Using Weblogic 9.2 on UNIX, servlet 2.4, jstl 1.1
    regards
    Edited by kings_citi at 04/26/2007 9:03 AM
    Edited by kings_citi at 04/26/2007 10:35 AM
    Edited by kings_citi at 04/26/2007 10:36 AM

    The problem doesn't look like it has anything to do with wappers per se. The stack indicates that the JVM died when the persistent store tried to invoke a standard Java synchronize operation. JVM crashes need to be analyzed by a JVM expert, so I second the suggestion to solicit help from JVM experts and/or filing a case with customer support. In the mean-time, you can probably work-around the issue by either (A) ensuring you have a recent version of the JVM installed, or (B) temporarily switching to the Sun JVM.
    Regards,
    tom
    Edited by: TomB on Sep 17, 2010 2:33 PM

Maybe you are looking for

  • How do I transfer a photo-file (the way it's organised on the phone) into a computer?

    I have organised pictures taken in different times into a folder on my phone, but I don't know how to transfer that folder exactly as it is into my computer. When I copy my photos through "My computer" then click on "iPhone device", I usually get the

  • LOBs tablespace issue

    Hello everyone!!! I'm using for testing an ORACLE XE on my own XP machine (which has a cluster of 4K), and I've created a tablespace for LOBs with those settings: CREATE TABLESPACE lobs_tablespace DATAFILE '.....lobs_datafile.dbf' SIZE 20M AUTOTEXTEN

  • Error 24, inputFolder.getFiles is not a function?

    i get this error when trying to run the script from photoshop. can you please tell me what im doing wrong? Thanks! #target photoshop app.bringToFront(); var layoutNumber = prompt('Please Enter layout Number'); var parentFolder = "C:/Users/Rob/Desktop

  • Conditonal Report Query

    Greetings all, This is a hot potato issue for me so coming straight to the experts so I can implement quickly. I have a report region that is based on a query. Select * FROM TABLENAME and this shows every record. This is the report that is on the mai

  • USB 3.0 DOCK Another problem

    Background info- X1 Carbon (non touch) I7 Windows 8 The dock works for the (usb wired) keyboard and mouse. Monitor output was not. Monitor works when plugged directly into the X1 via the mini display port. I downloaded the newest software update dire