Hi Dan,

I just want to add my previous post. I found somewhere in this forum, almost the same problem but in different context. Someone said that there might be jax-ws conflict. I don't really know what might caused the conflict, but from the previous log that I sent out, I found the following classes were instantiated when "Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory" in 2.3.0., while they are not the case in 2.2.10:

org.apache.cxf.service.factory.FactoryBeanListenerManager,
org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,
org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,
org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,
org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,

Does it give some useful information?

Thank you in advance.

/bayu


On 05-11-2010 04:02, Daniel Kulp wrote:
On Thursday 04 November 2010 12:57:32 pm Bayu Anggorojati wrote:
Hi Dan,

Thank you for your response. I endorse the JAXB 2.2 API jar, and the
wsdl2java works now.

However I faced another problem. When I try to access the web service
application after it is being deployed on tomcat, I got the following
error/message "No services have been found."

Do you know what might be causing this problem? because I never had this
problem with 2.2.x..

No idea on that one really.  Is there any useful information in the tomcat
logs?   Maybe a problem starting up the service?

Dan


Thank you in advance.

/bayu

On 04-11-2010 15:16, Daniel Kulp wrote:
Well, there are three potential workarounds for this:

1) Endorse the JAXB 2.2 API jar.

2) Use Java 5 instead of Java 6

3) Drop the jaxb-impl and jaxb-xjc jars down to 2.1.13 instead of 2.2.


I'll have to see if there is an easier way to detect this (other than an
UndeclaredThrowableException) and do something a little nicer than that.

Dan

On Thursday 04 November 2010 10:03:55 am Bayu Anggorojati wrote:
Here is the full stack trace:

org.apache.cxf.tools.common.ToolException:
java.lang.reflect.UndeclaredThrowableException

        at

org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner .java:279) at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
103 ) at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86) at
org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184) Caused
by: java.lang.reflect.UndeclaredThrowableException

        at $Proxy42.required(Unknown Source)
        at

com.sun.tools.xjc.generator.bean.field.AbstractField.annotateReference(A
bst ractField.java:187) at
com.sun.tools.xjc.generator.bean.field.AbstractField.annotate(AbstractFi
eld .java:156) at
com.sun.tools.xjc.generator.bean.field.AbstractListField.generate(Abstra
ctL istField.java:124) at
com.sun.tools.xjc.generator.bean.field.UntypedListField.<init>(UntypedLi
stF ield.java:107) at
com.sun.tools.xjc.generator.bean.field.UntypedListFieldRenderer.generate
(Un typedListFieldRenderer.java:72) at
com.sun.tools.xjc.generator.bean.field.DefaultFieldRenderer.generate(Def
aul tFieldRenderer.java:79) at
com.sun.tools.xjc.generator.bean.BeanGenerator.generateFieldDecl(BeanGen
era tor.java:759) at
com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGen
era tor.java:540) at
com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java
:24 3) at
com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.ja
va: 161) at com.sun.tools.xjc.model.Model.generateCode(Model.java:286)

        at

com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImp
l.j ava:252) at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImp
l.j ava:85) at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(
JAX BDataBinding.java:381) at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJava
Con tainer.java:573) at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaCo
nta iner.java:228) at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner .java:128) at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner .java:271) ... 4 more
Caused by: java.lang.NoSuchMethodException:
javax.xml.bind.annotation.XmlElementRef.required()

        at java.lang.Class.getDeclaredMethod(Class.java:1937)
        at

com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.jav
a:1 08) ... 23 more

/bayu

On 04-11-2010 15:00, Daniel Kulp wrote:
On Thursday 04 November 2010 8:08:57 am Bayu Anggorojati wrote:
Hi Dan,

I encountered this error when trying to generate the java code from
wsdl using wsdl2java from cfx 2.3.0:

WSDLToJava Error: java.lang.reflect.UndeclaredThrowableException

I never had this error with 2.2.10 at least. Is it a bug? or is there
any thing that I need to take care of in 2.30?

Thank you in advance.

Can you run with -verbose to get the full stack trace?

Not sure what would cause that.   The stack trace may help.

Dan

Bayu

On 03-11-2010 16:24, Daniel Kulp wrote:
What version of CXF?   At one point, there was a bug where
interceptors added to the endpoint directly didn't get added to the
chain.  Make sure you are using 2.3.0.

Also, in your code below, you are not setting any actions on the
Wss4jInInterceptor.  Thus, it may be bailing out fast as its not
supposed to do any actions.

Dan

On Wednesday 03 November 2010 5:24:49 am siuyab wrote:
Dear all,

Actually I posted this question under different thread, but I think
it's better to start as a new thread.

I have to say that I am new to web service and CXF stuff. I
currently trying to add simple username token of ws-security on an
already developed code which is using CXFNonSpringServlet.

In the override loadBus method, the endpoint is published in this
way: javax.xml.ws.Endpoint.publish("/query", service);

Then I followed the ws-security example as written in following
website, without configuring the Spring:
https://cwiki.apache.org/CXF20DOC/ws-security.html#WS-Security-addin
te rc ept ors

ws-security configuration at server side was also done in the
loadBus method.

At the server side however, I didn't follow exactly the same think
as shown in the example because in the example Endpoint refers to
org.apache.cxf.endpoint.Endpoint, but in the code it refers to
javax.xml.ws.Endpoint. So, here is the slightly modified code:


EndpointImpl jaxwsEndpoint =
(EndpointImpl)Endpoint.publish("/query", service);
Endpoint cxfEndpoint = (Endpoint)
jaxwsEndpoint.getServer().getEndpoint();

/** Adding Incoming Interceptors */
Map<String,Object>     inProps= new HashMap<String,Object>();

WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
((EndpointImpl) cxfEndpoint).getInInterceptors().add(wssIn);


I got the following error when client tries to execute the method in
web service:


Caused by: org.apache.cxf.binding.soap.SoapFault: MustUnderstand
headers:
[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity
-s e cext -1.0.xsd}Security] are not understood.

            at

org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unm
ar sh alF ault(Soap11FaultInInterceptor.java:75) at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.han
dl eM ess age(Soap11FaultInInterceptor.java:46) at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.han
dl eM ess age(Soap11FaultInInterceptor.java:35) at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercep
to rC hai n.java:243) at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMes
sa ge (Ab stractFaultChainInitiatorObserver.java:99) at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handle
Me ss age (CheckFaultInterceptor.java:69) at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handle
Me ss age (CheckFaultInterceptor.java:34) at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercep
to rC hai n.java:243) at
org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:700) at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handle
Re sp ons eInternal(HTTPConduit.java:2261) at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handle
Re sp ons e(HTTPConduit.java:2134) at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
HT TP Con duit.java:1988) at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:
66 )

            at

org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639
)

            at

org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEnd
in gI nte rceptor.handleMessage(MessageSenderInterceptor.java:62) at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterce
pt orC hai n.java:243) at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487) at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)

            at

org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:1
24 )

            ... 30 more

Can somebody give some clue on how to solve this issue please?
Perhaps this is very basic or stupid question, but any help will be
appreciated.

Regards,
Bayu



--
Kind Regards,
Bayu Anggorojati - Research Assistant

Wireless Security and Sensor Networks Group
Networking and Security Center for TeleInFrastruktur (CTIF), Aalborg University
Fredrik Bajers 7, room A3-211
Aalborg University
DK-9220  -  Denmark

Office    +45 9940 8661
Mobile    +45 5015 3183

Email: b...@es.aau.dk

Reply via email to