You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Corneliu <ma...@yahoo.com> on 2007/11/19 08:59:15 UTC

Re: service ok, client not...

Hello
I am having the same error.
I am using WebLogic 9.2 and trying to invoke a webservice using a client
created with cxf.
I receive the charsetname error. I resolved this error by setting the
folowing properties from java code:
<system-property
javax.xml.stream.XMLInputFactory="com.ctc.wstx.stax.WstxInputFactory" />
<system-property
javax.xml.stream.XMLOutputFactory="com.ctc.wstx.stax.WstxOutputFactory" />
<system-property
javax.xml.stream.XMLEventFactory="com.ctc.wstx.stax.WstxEventFactory" />
But somehow after this settings are set in web logic and other web services
are deployed, I receive another error saying that
com.ctc.wstx.stax.WstxInputFactory could not be found. This is because the
jar that contains com.ctc.wstx.stax.WstxInputFactory is not in the classpath
of weblogic.
If I try to put tis jar in the classpath of weblogic weblogic won;t start
anymore.
Does anyone know how can I solve this problem?
Regards Corneliu


Jan Kriesten wrote:
> 
> 
> hi willem,
> 
>> com.caucho.xml.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:149)
>> I just went through current CXF trunk's lib, and not found any thing
>> about com.caucho.xml.stream.XMLInputFactoryImpl
>> After I google it, I found it relates to resin.
>> In CXF, we use Woodstox (wstx-asl-3.2.1.jar)  as the stax
>> implementation, and we have a good test with it.
>> So please make sure the servlet can load Woodstox first.
> 
> right, this is from resin. i've changed the system properties for resin as
> follows:
> 
> <system-property
> javax.xml.stream.XMLInputFactory="com.ctc.wstx.stax.WstxInputFactory" />
> <system-property
> javax.xml.stream.XMLOutputFactory="com.ctc.wstx.stax.WstxOutputFactory" />
> <system-property
> javax.xml.stream.XMLEventFactory="com.ctc.wstx.stax.WstxEventFactory" />
> 
> 
> this seems to solve the problem, thanks for your help! :-) i've reported
> this
> problem to the resin team, hopefully they solve it for other users in the
> next
> release...
> 
> 
> cheers, --- jan.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/service-ok%2C-client-not...-tf3971584.html#a13829224
Sent from the cxf-user mailing list archive at Nabble.com.


Re: service ok, client not...

Posted by Corneliu <ma...@yahoo.com>.
Hello
I stil cannot deploy 2 applications. I have 2 ear application. Both are
invoking a webservice using a cxf client. After restarting weblogic the
first application deployed works and the seccond deployed is blocked when it
tries to invoke the web service and throws the folowing error(after the
first one was invoke was tested and had invoke the webservice succesfully):
javax.xml.ws.soap.SOAPFaultException: SOAPEXCEPTION
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
	at $Proxy25.publish(Unknown Source)
	at
org.csapi.wsdl.parlayx.presence.supplier.v3_2._interface.PresenceSupplier_PresenceSupplier_Client.main(PresenceSupplier_PresenceSupplier_Client.java:132)
Caused by: org.apache.cxf.binding.soap.SoapFault: SOAPEXCEPTION
	at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)


What I saw on server logs is that at the deployment time it throws the
folowing error for every application deployed.


java.net.ConnectException: Tried all: '1' addresses, but could not connect
over HTTP to server: 'java.sun.com', port: '80'
	at weblogic.net.http.HttpClient.openServer(HttpClient.java:361)
	at weblogic.net.http.HttpClient.openServer(HttpClient.java:430)
	at weblogic.net.http.HttpClient.<init>(HttpClient.java:159)
	at weblogic.net.http.HttpClient.<init>(HttpClient.java:149)
	at weblogic.net.http.HttpClient.New(HttpClient.java:265)
	........................................................................

Do you know what amI doing wrong?
Regards Corneliu
-- 
View this message in context: http://www.nabble.com/service-ok%2C-client-not...-tf3971584.html#a13872587
Sent from the cxf-user mailing list archive at Nabble.com.


Re: service ok, client not...

Posted by Jeff Yu <je...@iona.com>.
The weblogic.xml Web application deployment descriptor contains a 
<prefer-web-inf-classes> element (a sub-element of the 
|<container-descriptor>| element). By default, this element is set to 
False. Setting this element to True subverts the classloader delegation 
model so that class definitions from the Web application are loaded in 
preference to class definitions in higher-level classloaders. (From the 
http://edocs.bea.com/wls/docs92/programming/classloading.html)

So, it means it just uses child-first algorithm classloader(IMHO, it 
doesn't mean if you are using System.setProperty(..), its scope just for 
the specified application). the weblogc.xml is for the war, the 
weblogic-application.xml for the ear. In weblogic, for ear, it just has 
the package filter to ask weblogic use child-first algorithm classloader.

Back to your question, from your context:
1. You start your 1st application successfully, and then run a method 
which run "System.setProperties(...)".
2. You deploy another application, then it definitely would look for the 
"com.ctc.wst..." class, since you are setting it to System in your 1st 
application..

so, you need to make sure your 2nd application has the "com.ctc.ws..." 
class in its own library..

Thanks
Jeff

Corneliu wrote:
> Hello
> I made this changes and take weblogic.xml out from the war file.
> But I have the same error as at the begining:
> When I am running a method from my application and I am setting the folowing
> properties inside this method:
> 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.WstxEventFactory" );
>
> The next time I am trying to deploy another application to weblogic I am
> getting the folowing error :
> javax.xml.stream.FactoryConfigurationError: Provider
> com.ctc.wstx.stax.WstxInputFactory not found
>  at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
>  at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:120)
>  at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
>  at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
>  I belive that this error is because  the previous properties were set for
> the whole weblogic server and not only for my application.
> As I understud that the element  
> <prefer-web-inf-classes>true</prefer-web-inf-classes> from weblogic.xml will
> help me to load the above classes only for my application and not for the
> whole weblogic server. But since weblogic.xml is not needed where can I
> specify   <prefer-web-inf-classes>true</prefer-web-inf-classes>?
> Thank you
> Corneliu
>
>
> Jeff Yu wrote:
>   
>> In the weblogic-application.xml: add one more line:
>>
>> <package-name>com.ctc.wstx.stax.*</package-name>
>>
>> to let weblogic use your own package instead of weblogic's.
>>
>> One more thing, if you have ear, war... the ear's weblogic-application 
>> take precedence, which means the weblogic.xml do not take effect.
>>
>> Hope This Helps.
>> Jeff
>>
>>
>> Corneliu wrote:
>>     
>>> Hello thanks for your help
>>> After creating the ear file. I am receiving the folowing error at the
>>> deployment time when I am including weblogic.xml to the WEB-INF dir of
>>> the
>>> war file:
>>> java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory
>>> My weblogic.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
>>>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>>     <container-descriptor>        
>>>     <prefer-web-inf-classes>true</prefer-web-inf-classes>
>>>        </container-descriptor>
>>> </weblogic-web-app>
>>>
>>> My weblogic-application.xml
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
>>> 	<application-param>
>>> 		<param-name>webapp.encoding.default</param-name>
>>> 		<param-value>UTF-8</param-value>
>>> 	</application-param>
>>> 	<prefer-application-packages>
>>> 		<package-name>javax.jws.*</package-name>
>>> 	</prefer-application-packages>
>>> </weblogic-application>
>>> Without weblogic.xml I am able to deploy the web services.
>>>
>>> Regards Corneliu
>>>
>>>
>>> Jeff Yu wrote:
>>>   
>>>       
>>>> Hi,
>>>> Use the isolated & child-first algorithm classloader should resolve this 
>>>> issue.
>>>> See below two links.
>>>>
>>>> 1.
>>>> http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic
>>>> 2. http://edocs.bea.com/wls/docs92/programming/classloading.html
>>>>
>>>>
>>>> Thanks
>>>> Jeff
>>>>
>>>>
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>>     
>
>   

Re: service ok, client not...

Posted by Corneliu <ma...@yahoo.com>.
Hello
I made this changes and take weblogic.xml out from the war file.
But I have the same error as at the begining:
When I am running a method from my application and I am setting the folowing
properties inside this method:
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.WstxEventFactory" );

The next time I am trying to deploy another application to weblogic I am
getting the folowing error :
javax.xml.stream.FactoryConfigurationError: Provider
com.ctc.wstx.stax.WstxInputFactory not found
 at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
 at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:120)
 at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
 at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
 I belive that this error is because  the previous properties were set for
the whole weblogic server and not only for my application.
As I understud that the element  
<prefer-web-inf-classes>true</prefer-web-inf-classes> from weblogic.xml will
help me to load the above classes only for my application and not for the
whole weblogic server. But since weblogic.xml is not needed where can I
specify   <prefer-web-inf-classes>true</prefer-web-inf-classes>?
Thank you
Corneliu


Jeff Yu wrote:
> 
> In the weblogic-application.xml: add one more line:
> 
> <package-name>com.ctc.wstx.stax.*</package-name>
> 
> to let weblogic use your own package instead of weblogic's.
> 
> One more thing, if you have ear, war... the ear's weblogic-application 
> take precedence, which means the weblogic.xml do not take effect.
> 
> Hope This Helps.
> Jeff
> 
> 
> Corneliu wrote:
>> Hello thanks for your help
>> After creating the ear file. I am receiving the folowing error at the
>> deployment time when I am including weblogic.xml to the WEB-INF dir of
>> the
>> war file:
>> java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory
>> My weblogic.xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
>>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>     <container-descriptor>        
>>     <prefer-web-inf-classes>true</prefer-web-inf-classes>
>>        </container-descriptor>
>> </weblogic-web-app>
>>
>> My weblogic-application.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
>> 	<application-param>
>> 		<param-name>webapp.encoding.default</param-name>
>> 		<param-value>UTF-8</param-value>
>> 	</application-param>
>> 	<prefer-application-packages>
>> 		<package-name>javax.jws.*</package-name>
>> 	</prefer-application-packages>
>> </weblogic-application>
>> Without weblogic.xml I am able to deploy the web services.
>>
>> Regards Corneliu
>>
>>
>> Jeff Yu wrote:
>>   
>>> Hi,
>>> Use the isolated & child-first algorithm classloader should resolve this 
>>> issue.
>>> See below two links.
>>>
>>> 1.
>>> http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic
>>> 2. http://edocs.bea.com/wls/docs92/programming/classloading.html
>>>
>>>
>>> Thanks
>>> Jeff
>>>
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/service-ok%2C-client-not...-tf3971584.html#a13852992
Sent from the cxf-user mailing list archive at Nabble.com.


Re: service ok, client not...

Posted by Jeff Yu <je...@iona.com>.
In the weblogic-application.xml: add one more line:

<package-name>com.ctc.wstx.stax.*</package-name>

to let weblogic use your own package instead of weblogic's.

One more thing, if you have ear, war... the ear's weblogic-application 
take precedence, which means the weblogic.xml do not take effect.

Hope This Helps.
Jeff


Corneliu wrote:
> Hello thanks for your help
> After creating the ear file. I am receiving the folowing error at the
> deployment time when I am including weblogic.xml to the WEB-INF dir of the
> war file:
> java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory
> My weblogic.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>     <container-descriptor>        
>     <prefer-web-inf-classes>true</prefer-web-inf-classes>
>        </container-descriptor>
> </weblogic-web-app>
>
> My weblogic-application.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
> 	<application-param>
> 		<param-name>webapp.encoding.default</param-name>
> 		<param-value>UTF-8</param-value>
> 	</application-param>
> 	<prefer-application-packages>
> 		<package-name>javax.jws.*</package-name>
> 	</prefer-application-packages>
> </weblogic-application>
> Without weblogic.xml I am able to deploy the web services.
>
> Regards Corneliu
>
>
> Jeff Yu wrote:
>   
>> Hi,
>> Use the isolated & child-first algorithm classloader should resolve this 
>> issue.
>> See below two links.
>>
>> 1.
>> http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic
>> 2. http://edocs.bea.com/wls/docs92/programming/classloading.html
>>
>>
>> Thanks
>> Jeff
>>
>>
>>
>>
>>     
>
>   

Re: service ok, client not...

Posted by Corneliu <ma...@yahoo.com>.
Hello thanks for your help
After creating the ear file. I am receiving the folowing error at the
deployment time when I am including weblogic.xml to the WEB-INF dir of the
war file:
java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory
My weblogic.xml:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <container-descriptor>        
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
       </container-descriptor>
</weblogic-web-app>

My weblogic-application.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
	<application-param>
		<param-name>webapp.encoding.default</param-name>
		<param-value>UTF-8</param-value>
	</application-param>
	<prefer-application-packages>
		<package-name>javax.jws.*</package-name>
	</prefer-application-packages>
</weblogic-application>
Without weblogic.xml I am able to deploy the web services.

Regards Corneliu


Jeff Yu wrote:
> 
> Hi,
> Use the isolated & child-first algorithm classloader should resolve this 
> issue.
> See below two links.
> 
> 1.
> http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic
> 2. http://edocs.bea.com/wls/docs92/programming/classloading.html
> 
> 
> Thanks
> Jeff
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/service-ok%2C-client-not...-tf3971584.html#a13852295
Sent from the cxf-user mailing list archive at Nabble.com.


Re: service ok, client not...

Posted by Jeff Yu <je...@iona.com>.
Hi,
Use the isolated & child-first algorithm classloader should resolve this 
issue.
See below two links.

1.
http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic
2. http://edocs.bea.com/wls/docs92/programming/classloading.html


Thanks
Jeff

Corneliu wrote:
> Hello
> I am having the same error.
> I am using WebLogic 9.2 and trying to invoke a webservice using a client
> created with cxf.
> I receive the charsetname error. I resolved this error by setting the
> folowing properties from java code:
> <system-property
> javax.xml.stream.XMLInputFactory="com.ctc.wstx.stax.WstxInputFactory" />
> <system-property
> javax.xml.stream.XMLOutputFactory="com.ctc.wstx.stax.WstxOutputFactory" />
> <system-property
> javax.xml.stream.XMLEventFactory="com.ctc.wstx.stax.WstxEventFactory" />
> But somehow after this settings are set in web logic and other web services
> are deployed, I receive another error saying that
> com.ctc.wstx.stax.WstxInputFactory could not be found. This is because the
> jar that contains com.ctc.wstx.stax.WstxInputFactory is not in the classpath
> of weblogic.
> If I try to put tis jar in the classpath of weblogic weblogic won;t start
> anymore.
> Does anyone know how can I solve this problem?
> Regards Corneliu
>
>
> Jan Kriesten wrote:
>   
>> hi willem,
>>
>>     
>>> com.caucho.xml.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:149)
>>> I just went through current CXF trunk's lib, and not found any thing
>>> about com.caucho.xml.stream.XMLInputFactoryImpl
>>> After I google it, I found it relates to resin.
>>> In CXF, we use Woodstox (wstx-asl-3.2.1.jar)  as the stax
>>> implementation, and we have a good test with it.
>>> So please make sure the servlet can load Woodstox first.
>>>       
>> right, this is from resin. i've changed the system properties for resin as
>> follows:
>>
>> <system-property
>> javax.xml.stream.XMLInputFactory="com.ctc.wstx.stax.WstxInputFactory" />
>> <system-property
>> javax.xml.stream.XMLOutputFactory="com.ctc.wstx.stax.WstxOutputFactory" />
>> <system-property
>> javax.xml.stream.XMLEventFactory="com.ctc.wstx.stax.WstxEventFactory" />
>>
>>
>> this seems to solve the problem, thanks for your help! :-) i've reported
>> this
>> problem to the resin team, hopefully they solve it for other users in the
>> next
>> release...
>>
>>
>> cheers, --- jan.
>>
>>
>>
>>
>>     
>
>