Konstantin Kolinko schrieb am 20.11.2010 um 17:51 (+0300):
> 2010/11/20 Michael Ludwig <mil...@gmx.de>:
> > JAX-WS ships with Sun JDK 1.6 and seems the easiest way to code web
> > services on this platform. It is really easy to get started:
> >
> > http://java.dzone.com/articles/jax-ws-hello-world
> > http://java.dzone.com/articles/jax-ws-deployment-five-minute
> >
> > I have one question, though. JAX-WS is provided by JDK 1.6, so when I
> > start Tomcat 6 with a 1.6 JRE why can't it use the JAX-WS from the JRE?
> > Why do I have to supply a copy of JAX-WS (about 20 JARs in the ZIP you
> > can download from http://jax-ws.java.net/) in WEB-INF/lib? If I don't,
> > a ClassNotFoundException ensues. [1]
> >
> > Error configuring application listener of class 
> > com.sun.xml.ws.transport.http.servlet.WSServletContextListener
> > java.lang.ClassNotFoundException: 
> > com.sun.xml.ws.transport.http.servlet.WSServletContextListener
> 
> Because there is no such class in your JRE (and there is none in mine as 
> well).

You are right. Thanks.

Maybe I'm unclear about what constitutes the JRE and what doesn't.
Without anything special in "bin" or the env var CLASSPATH set or JAX-WS
in lib/ext, I can start the following from JRE 6:

G:\Eclipse35ws\JAX-WS :: C:\Programme\Java\jre6\bin\java.exe -cp bin 
juma.WSPublisher
starte juma.mohammad.greetingi...@addbf1 auf http://localhost:8283/ws/juma
20.11.2010 16:44:23 com.sun.xml.internal.ws.model.RuntimeModeler 
getRequestWrapperClass
INFO: Dynamically creating request wrapper Class juma.mohammad.jaxws.SayHello
20.11.2010 16:44:23 com.sun.xml.internal.ws.model.RuntimeModeler 
getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class 
juma.mohammad.jaxws.SayHelloResponse

I don't know if these com.sun.xml.internal.ws.* things are part of the
JRE or not, but they do seem to get loaded by "jre6\bin\java.exe", and
they are in rt.jar (runtime). So they are obviously part of the JRE?

> The same problem would be with
> com.sun.xml.ws.transport.http.servlet.WSServlet
> mentioned in the above article. There is no such class as well.
> 
> Using com.sun.* classes directly is not recommended. They are not part
> of the official API and can change without notice.

Yes.

> Also it would be strange to provide servlets in JDK/JRE, because
> javax.servlet.* is not part of JRE API.

I think my error was lumping all these com.sun.*.ws.* packages together.
Some of them do seem to be part of the JRE, others aren't.

So while JAX-WS is provided by the JRE, the servlet specific parts of it
aren't. Which is surprising in that I had assumed a servlet container
would be the usual host for web services. So maybe the JRE has enough to
run web service clients, but not web service servlets.

-- 
Michael Ludwig

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

Reply via email to