I found someone with a better knowledge of weblogic deployment then myself
and he got me around that problem.

1. add 
        <container-descriptor>
                <prefer-web-inf-classes>true</prefer-web-inf-classes>
        </container-descriptor>
to the weblogic.xml of the war file.
2. wrap the war in an ear file
3. add a weblogic-application.xml file to the META-INF directory of the ear
which contains
 <application-param> 
  <param-name>javax.xml.stream.XMLInputFactory</param-name> 
  <param-value>com.ctc.wstx.stax.WstxInputFactory</param-value> 
 </application-param>
4. deploy the ear instead of the war.

Not pretty but the application seems to run with 5.1.0.5 now on all weblogic
10.x versions we could test and all other applications deployed to the
server are still working too.
This solution is weblogic specific but there might be similar ways for
Glasfish or Websphere.


raucha wrote:
> 
> I tried both suggestions without success. Adding the parameter to the JVM
> prevents weblogic from starting and changing the system property in the
> AppModule crashes all other applications deployed to the server because
> they don't have the jars in their classpath.
> It seems I am stuck with 5.0.18 as long as tapestry depends on a specific
> implementation of Stax.
> 
> 
> Mario Udina-2 wrote:
>> 
>> Hello!
>> 
>> I put the following lines in the AppModule sine no other solution would
>> work
>> for me on Weblogic 9.2:
>> System.setProperty("javax.xml.stream.XMLInputFactory",
>>                 "com.ctc.wstx.stax.WstxInputFactory");
>>         System.setProperty("javax.xml.stream.XMLOutputFactory",
>>                 "com.ctc.wstx.stax.WstxOutputFactory");
>>         System.setProperty("javax.xml.stream.XMLEventFactory",
>>                 "com.ctc.wstx.stax.evt.WstxEventFactory");
>> 
>> I am not sure if that is ok but it works.
>> 
>> regards,
>> mario
>> 
>> 
>> On Thu, Jul 30, 2009 at 3:34 PM, Kristian Marinkovic <
>> kristian.marinko...@porsche.co.at> wrote:
>> 
>>> i had the same problem with websphere... i had to add following JVM
>>> parameter
>>> -Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
>>>
>>> with another version i had to drop the stax2 jar into a shared folder
>>> because the
>>> classloader wouldn't respect my parameter
>>>
>>> g,
>>> kris
>>>
>>>
>>>
>>> raucha <a.ra...@verband.creditreform.de>
>>> 30.07.2009 15:12
>>> Bitte antworten an
>>> "Tapestry users" <users@tapestry.apache.org>
>>>
>>>
>>> An
>>> users@tapestry.apache.org
>>> Kopie
>>>
>>> Thema
>>> ClassCastException after upgrading to 5.1.0.5
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> After upgrading from 5.0.18 to 5.1.0.5 my application fails to start
>>> when
>>> deployed on a weblogic server. I think this has to do with the usage of
>>> Stax
>>> in the TemplateParser. I have tried to override the implementation in my
>>> weblogic-application.xml with
>>>
>>>  <application-param>
>>>  <param-name>javax.xml.stream.XMLInputFactory</param-name>
>>>  <param-value>com.ctc.wstx.stax.WstxInputFactory</param-value>
>>>  </application-param>
>>>
>>> but I still get the following exception:
>>>
>>> Caused by: java.lang.ClassCastException:
>>> weblogic.xml.stax.XMLStreamInputFactory
>>>                 at
>>>
>>> org.apache.tapestry5.internal.services.TemplateParserImpl.(TemplateParserImpl.java:44)
>>>                 at
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>>                 at
>>>
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>>                 at
>>>
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>>                 at
>>> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>>>                 at
>>>
>>> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:62)
>>>
>>> Is there any way around this problem?
>>> --
>>> View this message in context:
>>>
>>> http://www.nabble.com/ClassCastException-after-upgrading-to-5.1.0.5-tp24738227p24738227.html
>>>
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ClassCastException-after-upgrading-to-5.1.0.5-tp24738227p24820982.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to