You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Lucky Sutanto <lu...@gmail.com> on 2013/02/13 11:58:31 UTC

Got java.lang.IllegalArgumentException when publishing application to Tomcat

Dear all,

I'm a newbie in Java web service development and I'm decided to use Apache
CXF framework to start learning about it.

Things that I have done so far:
1. Create dynamic web project
2. Import a simple WSDL sample
3. Generate Java class from that WSDL using CXF context menu in Eclipse
4. The Java code generated smoothly
5. But then when I try to run it on server/publish it on Tomcat
server(I've setup Tomcat
server instance in the Eclipse) I got error with following stacktrace in
the Tomcat console:

...
Caused by: java.lang.IllegalArgumentException: Cannot create URL for this
address soap.udp://239.255.255.250:3702
 at
com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:236)
at
org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:191)
 at
org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:116)
at
org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:72)
 at
org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
 at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
... 31 more
...

The configuration in my workstation:
- Apache CXF version: 2.7.1
- JAX-WS version 2.2.7
- Running on Windows 7 64-Bit and Java version 1.7.0_02 64-Bit version
- Web server: Apache Tomcat 7.0.35
- IDE: Eclipse Indigo
- The code is enclosed in this email


I really appreciate if you guys can help me out finding the culprit of this
problem.

Thank you,

Lucky Sutanto

Re: Got java.lang.IllegalArgumentException when publishing application to Tomcat

Posted by Lucky Sutanto <lu...@gmail.com>.
Dear Daniel,

I'm wondering how could you know that I have the RI on my classpath? *sorry
for this basic question

Perhaps I got this CXF concept wrong at the beginning. Now, based on your
statement and my latest discovery, I knew that CXF is the implementation of
JAX-WS, thus if I decided to go with CXF I don't need to touch the RI :D

In my previous experiment, apart from CXF setup, I have also installed the
RI on my environment by exactly doing the instructions I found on
http://jax-ws.java.net/2.2.7/docs/ch02.html#installation-instructions

However, last night finally I solved this problem by downgrading the CXF
version to 2.6.3. But still I don't understand the exact root cause though
:P

Thanks,
Lucky

On Wed, Feb 13, 2013 at 11:16 PM, Daniel Kulp <dk...@apache.org> wrote:

>
> On Feb 13, 2013, at 5:58 AM, Lucky Sutanto <lu...@gmail.com>
> wrote:
>
> Dear all,
>
> I'm a newbie in Java web service development and I'm decided to use Apache
> CXF framework to start learning about it.
>
> Things that I have done so far:
> 1. Create dynamic web project
> 2. Import a simple WSDL sample
> 3. Generate Java class from that WSDL using CXF context menu in Eclipse
> 4. The Java code generated smoothly
> 5. But then when I try to run it on server/publish it on Tomcat server(I've setup Tomcat
> server instance in the Eclipse) I got error with following stacktrace in
> the Tomcat console:
>
> ...
> Caused by: java.lang.IllegalArgumentException: Cannot create URL for this
> address soap.udp://239.255.255.250:3702
>  at
> com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:236)
> at
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:191)
>  at
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:116)
> at
> org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:72)
>  at
> org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
> at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
>  at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
> ... 31 more
> ...
>
> The configuration in my workstation:
> - Apache CXF version: 2.7.1
> - JAX-WS version 2.2.7
>
>
> Can I ask why you have both CXF and the RI on the classpath at the same
> time?  That looks like it's part of the issue.  The WS-Discovery stuff is
> picking up the RI instead of CXF.
>
> Dan
>
>
>
> - Running on Windows 7 64-Bit and Java version 1.7.0_02 64-Bit version
> - Web server: Apache Tomcat 7.0.35
> - IDE: Eclipse Indigo
> - The code is enclosed in this email
>
>
> I really appreciate if you guys can help me out finding the culprit of
> this problem.
>
> Thank you,
>
> Lucky Sutanto
> <WSDL2JavaTest.zip>
>
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>

Re: Got java.lang.IllegalArgumentException when publishing application to Tomcat

Posted by Daniel Kulp <dk...@apache.org>.
On Feb 13, 2013, at 5:58 AM, Lucky Sutanto <lu...@gmail.com> wrote:

> Dear all,
> 
> I'm a newbie in Java web service development and I'm decided to use Apache CXF framework to start learning about it.
> 
> Things that I have done so far:
> 1. Create dynamic web project
> 2. Import a simple WSDL sample
> 3. Generate Java class from that WSDL using CXF context menu in Eclipse
> 4. The Java code generated smoothly
> 5. But then when I try to run it on server/publish it on Tomcat server (I've setup Tomcat server instance in the Eclipse) I got error with following stacktrace in the Tomcat console:
> 
> ...
> Caused by: java.lang.IllegalArgumentException: Cannot create URL for this address soap.udp://239.255.255.250:3702
> 	at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:236)
> 	at org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:191)
> 	at org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:116)
> 	at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:72)
> 	at org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
> 	at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
> 	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
> 	... 31 more
> ...
> 
> The configuration in my workstation:
> - Apache CXF version: 2.7.1
> - JAX-WS version 2.2.7

Can I ask why you have both CXF and the RI on the classpath at the same time?  That looks like it's part of the issue.  The WS-Discovery stuff is picking up the RI instead of CXF.

Dan



> - Running on Windows 7 64-Bit and Java version 1.7.0_02 64-Bit version
> - Web server: Apache Tomcat 7.0.35
> - IDE: Eclipse Indigo
> - The code is enclosed in this email
> 
> 
> I really appreciate if you guys can help me out finding the culprit of this problem. 
> 
> Thank you,
> 
> Lucky Sutanto
> <WSDL2JavaTest.zip>

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Got java.lang.IllegalArgumentException when publishing application to Tomcat

Posted by Lucky Sutanto <lu...@gmail.com>.
Hi Mark,

Thanks for showing me a useful learning sources :)

Warm regards,
Lucky

On Thu, Feb 14, 2013 at 10:39 AM, Mark Streit <mc...@gmail.com> wrote:

> Could I suggest that you check out the tutorials at Glen Mazza's blog on
> JAX-WS development. They use Maven, they build from the command line and
> work out of the box.
>
> They also focus on the web service development aspects and the artifacts
> that get created from the JAX-WS tools (ie: CXF's wsdl2java, java2wsdl).
>  He has instructions on how to run the Maven goal to prepare the projects
> for Import into the Eclipse IDE.  This way, you eliminate potential
> confusion introduced by what the Eclipse IDE may or may not have installed
> as part of its tooling.  He covers use of both CXF and the RI (Metro).
>
> http://www.jroller.com/gmazza/entry/blog_article_index
>
> Hope this helps.
>
> On Wed, Feb 13, 2013 at 5:58 AM, Lucky Sutanto <lucky.sutanto@gmail.com
> >wrote:
>
> > Dear all,
> >
> > I'm a newbie in Java web service development and I'm decided to use
> Apache
> > CXF framework to start learning about it.
> >
> > Things that I have done so far:
> > 1. Create dynamic web project
> > 2. Import a simple WSDL sample
> > 3. Generate Java class from that WSDL using CXF context menu in Eclipse
> > 4. The Java code generated smoothly
> > 5. But then when I try to run it on server/publish it on Tomcat
> server(I've setup Tomcat
> > server instance in the Eclipse) I got error with following stacktrace in
> > the Tomcat console:
> >
> > ...
> > Caused by: java.lang.IllegalArgumentException: Cannot create URL for this
> > address soap.udp://239.255.255.250:3702
> >  at
> >
> com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:236)
> > at
> >
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:191)
> >  at
> >
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:116)
> > at
> >
> org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:72)
> >  at
> >
> org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
> > at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
> >  at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
> > ... 31 more
> > ...
> >
> > The configuration in my workstation:
> > - Apache CXF version: 2.7.1
> > - JAX-WS version 2.2.7
> > - Running on Windows 7 64-Bit and Java version 1.7.0_02 64-Bit version
> > - Web server: Apache Tomcat 7.0.35
> > - IDE: Eclipse Indigo
> > - The code is enclosed in this email
> >
> >
> > I really appreciate if you guys can help me out finding the culprit of
> > this problem.
> >
> > Thank you,
> >
> > Lucky Sutanto
> >
>
>
>
> --
> Mark *
> **
> *
>

Re: Got java.lang.IllegalArgumentException when publishing application to Tomcat

Posted by Mark Streit <mc...@gmail.com>.
Could I suggest that you check out the tutorials at Glen Mazza's blog on
JAX-WS development. They use Maven, they build from the command line and
work out of the box.

They also focus on the web service development aspects and the artifacts
that get created from the JAX-WS tools (ie: CXF's wsdl2java, java2wsdl).
 He has instructions on how to run the Maven goal to prepare the projects
for Import into the Eclipse IDE.  This way, you eliminate potential
confusion introduced by what the Eclipse IDE may or may not have installed
as part of its tooling.  He covers use of both CXF and the RI (Metro).

http://www.jroller.com/gmazza/entry/blog_article_index

Hope this helps.

On Wed, Feb 13, 2013 at 5:58 AM, Lucky Sutanto <lu...@gmail.com>wrote:

> Dear all,
>
> I'm a newbie in Java web service development and I'm decided to use Apache
> CXF framework to start learning about it.
>
> Things that I have done so far:
> 1. Create dynamic web project
> 2. Import a simple WSDL sample
> 3. Generate Java class from that WSDL using CXF context menu in Eclipse
> 4. The Java code generated smoothly
> 5. But then when I try to run it on server/publish it on Tomcat server(I've setup Tomcat
> server instance in the Eclipse) I got error with following stacktrace in
> the Tomcat console:
>
> ...
> Caused by: java.lang.IllegalArgumentException: Cannot create URL for this
> address soap.udp://239.255.255.250:3702
>  at
> com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:236)
> at
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:191)
>  at
> org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:116)
> at
> org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:72)
>  at
> org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
> at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
>  at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
> ... 31 more
> ...
>
> The configuration in my workstation:
> - Apache CXF version: 2.7.1
> - JAX-WS version 2.2.7
> - Running on Windows 7 64-Bit and Java version 1.7.0_02 64-Bit version
> - Web server: Apache Tomcat 7.0.35
> - IDE: Eclipse Indigo
> - The code is enclosed in this email
>
>
> I really appreciate if you guys can help me out finding the culprit of
> this problem.
>
> Thank you,
>
> Lucky Sutanto
>



-- 
Mark *
**
*