Skip to main content

Spring support in JAX-WS

87 replies [Last post]
kohsuke
Offline
Joined: 2003-06-09
Points: 0

Originally posted as http://weblogs.java.net/blog/kohsuke/archive/2007/01/spring_support.html

I'm seeing a lot of comments, and doing Q&A on the blog comment section is hard, so redirecting people to post their questions here.

You can "watch" a thread to be notified whenever someone posts a new message to your post.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
addy_bhardwaj
Offline
Joined: 2008-07-02
Points: 0

I got the same exception i.e. java.lang.NoClassDefFoundError: com/sun/istack/XMLStreamReaderToContentHandler

When I looked at the pom.xml for jaxws-spring-1.8.jar and found there was an unnecessary dependency declared which is breaking the code. Here is the problem:

If you look at the jaxws-rt-2.1.3.jar pom.xml it has dependency on jaxb-impl-2.1.6.jar. In the jaxws-spring-1.8 pom.xml you have dependency on jaxws-rt-2.1.3.jar and that should drag the dependent jars with it. But ..
the pom.xml has jaxb-impl-2.1.2.jar which really doesn't need to be there. Hence causes the applications to throw
java.lang.NoClassDefFoundError: com/sun/istack/XMLStreamReaderToContentHandler

Also you can see a comment in the pom that dependency in jaxws-rt was not correct when this code was written and hence the pom was made the way it was (my guess!!!)

Here is what I had to do to overcome the issue:


com.sun.xml.ws
jaxws-rt
2.1.3


org.jvnet.jax-ws-commons.spring
jaxws-spring
1.8


com.sun.xml.ws
jaxws-rt


javax.jws
jsr181-api


com.sun.xml.bind
jaxb-impl


javax.xml.soap
saaj-api


com.sun.xml.messaging.saaj
saaj-impl


com.sun.xml.stream.buffer
streambuffer


com.sun.xml.stream
sjsxp


com.sun.org.apache.xml.internal
resolver


org.jvnet.staxex
stax-ex


javax.annotation
jsr250-api


javax.activation
activation


javax.servlet
servlet-api



willemsrb
Offline
Joined: 2007-02-08
Points: 0

Sorry to take so long, but i've been too busy for my own good.... i'll just drop the code here because i don't have much time to get it up nice and generic... It is based on the 1.1 spring binding and i've noticed a few changes that won't work anymore at the moment...

Message Endpoint:
[code]
import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
import com.sun.xml.ws.transport.http.servlet.ServletAdapterList;
import com.sun.xml.ws.transport.http.servlet.SpringBindingList;

import java.io.IOException;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;

/**
* MDP that supports message driven webservice endpoints.
*/
public class MessageEndpoint implements MessageListener {

/**
* Constructor.
*
* @param bindings
* @param url
* @param replyQueueFactory
* @param replyQueue
*/
public MessageEndpoint(final SpringBindingList bindings, String url, QueueConnectionFactory replyQueueFactory, Queue replyQueue) {
ServletAdapterList adapterList = bindings.create();
for (ServletAdapter adapter: adapterList) {

if (url.equals(adapter.getValidPath())) {
jmsAdapter = new JMSAdapter(adapter.getEndpoint());
}
}

if (jmsAdapter == null) {
throw new RuntimeException("URL not found in Spring defined endpoints. No adapter could be made to handle messages.");
}

this.replyQueue = replyQueue;
this.replyQueueFactory = replyQueueFactory;
}

/** Adapter to handle messages. */
private static volatile JMSAdapter jmsAdapter;

/** Queue factory for return message. */
private QueueConnectionFactory replyQueueFactory;

/** Queue for return message. */
private Queue replyQueue;

/**
* Handle a new message on the queue. Wraps the message in a JMS Connection and call the configured JMS adapter.
* @param message the message
*/
public void onMessage(final Message message) {
try {
// Hier komt de logica om een connection te maken, de connection weet waar de reply naar toe moet
JMSConnectionImpl connection = new JMSConnectionImpl(message, replyQueueFactory, replyQueue);
// Handle the message
jmsAdapter.handle(connection);
} catch (JMSException e) {
throw new RuntimeException("Unexpected jms-error in MDP", e);
} catch (IOException e) {
throw new RuntimeException("Unexpected io-error in MDP", e);
}
}
}
[/code]

JMSConnectionImpl:
[code]
import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQQueue;

import com.sun.xml.ws.api.message.Packet;
import com.sun.xml.ws.api.server.WSEndpoint;
import com.sun.xml.ws.api.server.WebServiceContextDelegate;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import java.security.Principal;

import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
* Connection is used to store the incoming message and stream it from and
* act as a holder for the response.
*
*/
public class JMSConnectionImpl implements WebServiceContextDelegate {

/** Logger. */
private static Log log = LogFactory.getLog(JMSConnectionImpl.class);

/** Original ID of request message. */
private String requestMessageJMSID;

/** Inputstream buffer to stream incoming message. */
private byte[] inputStreamBuffer;

/** Number of bytes to ignore at start of buffer for inputstream. */
private int inputStreamRemoveBytes = 0;

/** Outputstream to temporary store outgoing message. */
private ByteArrayOutputStream outputStream;

/** ConnectionFactory for queue for outgoing message. */
private QueueConnectionFactory replyQueueFactory;

/** Queue for outgoing message. */
private Queue replyQueue;

/**
* Constructor.
*
* @param requestMessage incoming message
* @param replyQueueFactory connectionfactory for outgoing message
* @param replyQueue queue for outgoing message
* @throws JMSException on jms error
*/
public JMSConnectionImpl(final Message requestMessage, final QueueConnectionFactory replyQueueFactory, final Queue replyQueue) throws JMSException {
// Prepare outputstream
outputStream = new ByteArrayOutputStream();

// Store original JMS ID
requestMessageJMSID = requestMessage.getJMSCorrelationID();

// Prepare inputstream buffer
inputStreamBuffer = null;

if (requestMessage instanceof BytesMessage) {
log.debug( "Received bytes message ..." ) ;
inputStreamBuffer = new byte[(int)((BytesMessage)requestMessage).getBodyLength()];
((BytesMessage)requestMessage).readBytes(inputStreamBuffer);
} else if (requestMessage instanceof TextMessage) {
log.debug( "Received text message ..." ) ;
inputStreamBuffer = ((TextMessage)requestMessage).getText().getBytes();
} else {
throw new JMSException("Invalid message format: " + requestMessage.getClass().getName());
}

// log.debug( "BOM check byte 0: " + inputStreamBuffer[0] );
// log.debug( "BOM check byte 1: " + inputStreamBuffer[1] );
// log.debug( "BOM check byte 2: " + inputStreamBuffer[2] );
// log.debug( "BOM check byte 3: " + inputStreamBuffer[3] );
//
//
// // Remove BOM (Byte Order Mark)
// //
// // +-----------------------------------------+
// // | Bytes | Encoding Form |
// // +-----------------------------------------+
// // | 00 00 FE FF | UTF-32, big-endian |
// // | FF FE 00 00 | UTF-32, little-endian |
// // | FE FF | UTF-16, big-endian |
// // | FF FE | UTF-16, little-endian |
// // | EF BB BF | UTF-8 |
// // +-----------------------------------------+
// if (inputStreamBuffer[0] == (byte)0xEF && inputStreamBuffer[1] == (byte)0xBB && inputStreamBuffer[1] == (byte)0xBF) {
// inputStreamRemoveBytes = 3;
// log.debug("Removing first three bytes of stream because of BOM.");
// } else if ((inputStreamBuffer[0] == (byte)0x00 && inputStreamBuffer[1] == (byte)0x00 && inputStreamBuffer[2] == (byte)0xFE && inputStreamBuffer[3] == (byte)0xFF) || (inputStreamBuffer[0] == (byte)0xFF && inputStreamBuffer[1] == (byte)0xFE && inputStreamBuffer[2] == (byte)0x00 && inputStreamBuffer[3] == (byte)0x00)) {
// inputStreamRemoveBytes = 4;
// log.warn("Removing first four bytes of stream because of BOM (untested!).");
// } else if ((inputStreamBuffer[0] == (byte)0xFE && inputStreamBuffer[1] == (byte)0xFF) || (inputStreamBuffer[0] == (byte)0xFF && inputStreamBuffer[1] == (byte)0xFE)) {
// inputStreamRemoveBytes = 2;
// log.warn("Removing first two bytes of stream because of BOM (untested!).");
// }
// else {
// log.debug( "No BOM detected." ) ;
// }

inputStreamRemoveBytes = new String( inputStreamBuffer ).indexOf( " log.debug("Removing first " + inputStreamRemoveBytes + " of stream because of BOM or useless crap in message.");

if( inputStreamRemoveBytes == -1 ) {
log.warn( "Message does not contain inputStreamRemoveBytes = 0 ;
}

// Log incoming message
log.debug("Message received on queue:\n" + new String(inputStreamBuffer));

// Configuration for transmission
this.replyQueueFactory = replyQueueFactory;
this.replyQueue = replyQueue;

if (this.replyQueue instanceof MQQueue) {
log.debug("Setting replyQueue target client to non-jms");
((MQQueue)this.replyQueue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
}
}

/**
* Returns a stream to the incoming message.
* @return A stream to the incoming message.
*/
public InputStream getInputStream() throws JMSException {

ByteArrayInputStream bais = new ByteArrayInputStream(inputStreamBuffer, inputStreamRemoveBytes, inputStreamBuffer.length - inputStreamRemoveBytes);
return (bais);
}

/**
* Retuns a stream that the outgoing message can be written to.
* @return A stream that the outgoing message can be written to.
*/
public OutputStream getOutputStream() {
return (outputStream);
}

/**
* Transmit the outgoing message.
*
* @throws JMSException on jms errors
* @throws IOException on read/write errors
*/
public void transmit() throws JMSException, IOException {
if (outputStream != null) {
outputStream.flush();
}

QueueConnection connection = replyQueueFactory.createQueueConnection();

try {
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

try {
// BytesMessage replyMessage = jmsSession.createBytesMessage();
// byte[] content = ((ByteArrayOutputStream)getOutputStream()).toByteArray();
// if (content.length > 0) {
// replyMessage.writeBytes(content);
// }

TextMessage replyMessage = session.createTextMessage();
replyMessage.setJMSCorrelationID(requestMessageJMSID);
replyMessage.setText(new String(outputStream.toByteArray()));
// System.out.println( "Reply message id : \n" + replyMessage.getJMSMessageID() );
// System.out.println( "Reply message correlation id : \n" + replyMessage.getJMSCorrelationID() );

QueueSender sender = session.createSender(replyQueue);
try {
sender.send(replyMessage);

log.debug("Message sent via queue: \n" + replyMessage.getText());
} finally {
sender.close();
}
} finally {
session.close();
}
} finally {
connection.close();
}
}

/**
* NOT IMPLEMENTED: for WebServiceContextDelegate.
*
* @param packet packet
* @return null
*/
public Principal getUserPrincipal(final Packet packet) {
return null;
}

/**
* NOT IMPLEMENTED: for WebServiceContextDelegate.
*
* @param packet packet
* @param role role
* @return false
*/
public boolean isUserInRole(final Packet packet, final String role) {
return false;
}

/**
* NOT IMPLEMENTED: for WebServiceContextDelegate.
*
* @param packet packet
* @param wsEndpoint endpoint
* @return null
*/
public String getEPRAddress(final Packet packet, final WSEndpoint wsEndpoint) {
return null;
}

/**
* NOT IMPLEMENTED: for WebServiceContextDelegate.
*
* @param packet packet
* @param wsEndpoint endpoint
* @return null
*/
public String getWSDLAddress(final Packet packet, final WSEndpoint wsEndpoint) {
return null;
}
}
[/code]

JMSAdapter:
[code]
import com.sun.xml.ws.api.message.Packet;
import com.sun.xml.ws.api.pipe.Codec;
import com.sun.xml.ws.api.server.TransportBackChannel;
import com.sun.xml.ws.api.server.WSEndpoint;
import com.sun.xml.ws.api.server.WSEndpoint.PipeHead;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;

import java.io.InputStreamReader;
import java.io.OutputStream;

import java.io.PrintStream;

import javax.jms.JMSException;

/**
* Adapter for JMS transport.
*/
public class JMSAdapter implements TransportBackChannel {

/** The WS endpoint. */
private WSEndpoint endpoint;

/** Codec used the encode/decode packets. */
private Codec codec;

/** Handle the call to the endpoint. */
private PipeHead head;

/**
* Constructor.
* @param endpoint the ws endpoint
*/
public JMSAdapter(final WSEndpoint endpoint) {
this.endpoint = endpoint;
codec = endpoint.createCodec();
head = endpoint.createPipeHead();
}

/**
* Handle the request stored in the given JSM connection.
*
* @param connection JMS connection
* @throws IOException on read/write erros
* @throws JMSException on jms errors
*/
public void handle(final JMSConnectionImpl connection) throws IOException, JMSException {

//System.out.println( "Decode request ..." ) ;

try {
// Decode request
Packet packet = new Packet();
codec.decode(connection.getInputStream(), "text/xml", packet);
//System.out.println( "Request packet: " + packet ) ;

// Handle request
//System.out.println( "Handle request ..." ) ;
packet = head.process(packet, connection, this);
//System.out.println( "Response package: " + packet ) ;

// Encode response
//System.out.println( "Encode response ... " ) ;
OutputStream os = connection.getOutputStream();
codec.encode(packet, os);
os.close();
} catch (Exception e) {
// Create error message, move to dead letter queue
OutputStream os = connection.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("Onverwachte fout tijdens transport opgetreden: " + e.getMessage());

BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line = null;

while ((line = br.readLine()) != null) {
ps.println(line);
}

os.close();
}

// Transmit reponse
//System.out.println( "Transmit response ... " ) ;
connection.transmit();

//System.out.println( "Done ..." ) ;
}

/**
* NOT USED: Close the connection.
*/
public void close() {
}
}
[/code]

A lot of code is taken from the JMS transport project here in JAX-WS but changed a little for use in this situation.

The Spring config to get it working:
[code]

xmlns:ws= "http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://jax-ws.dev.java.net/spring/core http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet http://jax-ws.dev.java.net/spring/servlet.xsd" >





serviceName="ns1:MyService"
portName="ns1:MyHTTPPort"
xmlns:ns1="http://some.namespace/something"
>




serviceName="ns1:MyService"
portName="ns1:MyJMSPort"
xmlns:ns1="http://some.namespace/something"
>









class="org.springframework.jms.listener.DefaultMessageListenerContainer102">



[/code]

Hope this helps someone...

Regards,
Robert

keithwillard
Offline
Joined: 2007-04-10
Points: 0

We would also be very interested. I am more interested in how you did the Spring JAXWS integration with the JMS transport than in using the code itself.

What we want to do is to create a JMS transport layer similar to what we have done for Axis1, and XFire which is to use the Jencks JCA container and the Spring JMSTemplate classes to minimize our JMS code and to instantiate the service from Spring.

--Keith

alexj
Offline
Joined: 2007-03-02
Points: 0

Kohsuke - Can you have a look at this issue. Was trying to use XWSS for security in JAX-WS Spring Integration. With the xws-security.jar from JAX-WS or WSIT projects it does not pickup the server_security_config.xml. So I had a Security Handler and callback and it works. But with this solution from the client side the mustUnderstand=1 was failing. KumarJayanti suggested for JSE5 and JAX-WS there is no need for the Handler and using the latest xws-security.jar from XWSS3.0 at xwss.dev.java.net will have the extra SPI implementation that allows standalone XWSS (Non-WSIT) applications to work.

I tried and works fine with JSE5 and JAX-WS without the Spring integration. When using the Spring integration getting the following error.

http://forums.java.net/jive/thread.jspa?messageID=210568#210568

Is there an easier way to use XWSS with Spring Integration I am missing. My plan is to implement WSIT once some other issues are solved when used with Tomcat.

Is there a plan to add XWSS support. We could have something like





PASSWORD1

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I haven't figured out how to sort postings in date order, so it's becoming increasingly painful to find what's the new post in this thread. So please consider starting a new topic whenever you have issues with JAX-WS/Spring integration.

In the post referenced from your post, you say that the NPE occurs in:

>InputStream in = ctxt.getResourceAsStream(serverConfig);

What is that 'ctxt'? ServletContext? There's a bug filed in jaxws-spring this morning about jaxws-spring not injecting ServletContext properly. Could that be related? Or is it filed by you?

I think there's also another bug here. That is, XWSS shouldn't be relying on any particular transport, so if it can only work when ServletContext is not null, it has a problem. You should let Kumar know that.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

One more thing. Does this problem only happen in JDK6?

plynch
Offline
Joined: 2006-08-20
Points: 0

:) I mentioned it twice in my comments in the bug that this affected jaxws-spring.

Sorry for the confusion, I merely wanted to provide the simplest test case possible to reproduce the issue in case configuring a complete jaxws spring test app would have been seen as too much work for the bug fixer.

I don't remember if I tried JDK 5. But I was able to reproduce the exact same issue with Tomcat 5.5.20, and 5.5.12 with JDK 6. I suppose you must have successfully run the test app on something so maybe you can tell me if it worked with JDK 5. jaxws-spring appears to have some satisfied users, which is why I struggled so long trying to resolve it. I ended up just going with the very simple ( and so far working ) DefaultLocatorFactory model spring provides to suck things into my SEI.

-Peter

kohsuke
Offline
Joined: 2003-06-09
Points: 0

No, you've done the right thing. And thank you very much for trying to create a simplest possible test case. Much appreciated, and sorry for dropping the ball on our side.

For testing jaxws-spring I use Jetty, since it's better integrated to Maven.

In any case the bug is reopened, so let's see how it goes...

alexj
Offline
Joined: 2007-03-02
Points: 0

A question on the handlers @PostConstruct and @PreDestroy annotations. The Webservice and both the handlers are working fine.
...








...

With the sun-jaxws.xml and Servlet both @PostConstruct and @PreDestroy works. With the jaxws-spring @PostConstruct works only for the WebService and not for the Handlers. @PreDestroy does not work for any. Is this a known issue ?
These does'nt get called. Maybe I should look at the WSSpringServlet init and destroy methods ?

Do we need this in the init
delegate.init(servletConfig);

and this in the destroy
public void destroy() {
if (delegate != null) {
delegate.destroy();
}
}

I am using RI 2.1 in tomcat. Is this supported in Glassfish.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

The handlers are now created by Spring, so I guess that's why the @PostConstruct and @PreDestroy are not invoked anymore.

Since you are now using Spring, you should do it in the Spring way. See http://static.springframework.org/spring/docs/2.0.x/reference/beans.html...

alexj
Offline
Joined: 2007-03-02
Points: 0

Thanks kohsuke. That is true, maybe I should let Spring handle the complete lifecycle. I will dig in to see why @PostConstruct worked for @Webservice.

In the WSSpringServlet why do we not have the delegate.init(servletConfig) in the init() and the delegate.destroy() in the destroy() methods.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I actually don't see delegate.init() call anywhere...

alexj
Offline
Joined: 2007-03-02
Points: 0

I was comparing with the com.sun.xml.ws.transport.http.servlet.WSServlet init() and destroy() and WSSpringServlet and suspected that is why the @PostConstruct and @PreDestroy not working for the Handlers and @PreDestroy not for the WebService.

I have implemented using Spring way and works fine now.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

We should be able to do something similar.

Are we trying to inject Service, or port?

jitu
Offline
Joined: 2003-06-14
Points: 0

In @WebServiceRef case, one can do both.

willemsrb
Offline
Joined: 2007-02-08
Points: 0

Hi,

i thought i saw this aswell... i think i solved it then by adding the xbean-2.2.0.jar and xbean-spring-2.7.jar dependencies...

Regards,
Robert

plynch
Offline
Joined: 2006-08-20
Points: 0

I think what you are referring too is the misleading example given in the docs.
found on the main page
https://jax-ws-commons.dev.java.net/spring/

It states:

xmlns:ws= "http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet">

That was another gotcha. The above from the example applicationContext.xml is not enough.

You need to define the xsi:schemaLocation or else yeah it won't work - at least for me it didn't.

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.dev.java.net/spring/servlet.xsd
">

Someone cutting and pasting from the docs will get confused. It was only after comparing the test-app application context file that I noticed that problem.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

Thanks. I updated the site.

I'll push the new version shortly.

jessie_zh
Offline
Joined: 2007-02-15
Points: 0

Somehow I got exception on my configuration:

14:28:46,332 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://jax-ws.dev.java.net/spring/servlet]

Can anyone give me some insights?

Thanks a lot.

jessie_zh
Offline
Joined: 2007-02-15
Points: 0

I think I know the problem. I just migrated to spring2, but somehow there is an old version of spring still there.

cmoesel
Offline
Joined: 2006-02-16
Points: 0

Hi Kohsuke,

It looks like the two XSD documents have changed since 1.0 and now the previously working configuration no longer works (doesn't validate against XSDs). I tried to find the source of this myself, but I don't know xbeans well enough to figure it out.

In spring-jax-ws-core.xsd (line 208) and spring-jax-ws-servlet.xsd (lines 28 and 73), the line:

has changed to:

Now the configuration *requires* an extra element from another namespace! Whoops. Anyway, as I said, I don't know how to fix this in the code, since I think those XSDs are generated by xbean. But I wanted to point it out.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I actually thought I fixed that bug --- to fix that bug I even created a forked maven-xbean-plugin.

Where did you find those XSDs? As far as I can tell, they do have @minOccurs and @maxOccurs.

cmoesel
Offline
Joined: 2006-02-16
Points: 0

Hi Kohsuke,

I did an svn update and then a mvn clean package from the spring directory. The resulting jar file had the bad XSDs in it (they were also in target/classes). Note, this is from the most current code in SVN, not necessarily the 1.1 release.

Just did one more svn up and mvn clean install to be sure and still got the faulty XSDs.

stephenburns
Offline
Joined: 2004-11-20
Points: 0

Even with the new 1.1 code I cant get the primaryWsdl to work. The input Object is of type QName when it calls the setPrimaryWsdl method so it drops through to the IllegalArgumentException.
Any suggestions?

kohsuke
Offline
Joined: 2003-06-09
Points: 0

Thanks for finding this. I just commited a fix.

Would be interested in becoming a developer on the project? That would allow you to make this kind of changes without waiting for me.

willemsrb
Offline
Joined: 2007-02-08
Points: 0

Hi Kohsuke,

thanks for the offer, but unfortunately, i'm too busy with my own work at the moment to be much of help... but if i find anything, i'll share...

Regards,
Robert

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I changed the artifactId to jaxws-spring.

cgage
Offline
Joined: 2008-12-02
Points: 0

Do you know if the all-in-one download zip file containing all of the necessary jar files was created or posted somewhere?
I am not using Maven. I am using MyEclipse ide, with Java 1.5.0 and am getting a lot of the same errors users have posted here. I am trying to use Spring 2.5 with jax-ws 2.1 and jdk 1.5.0_12. Do I need to use jdk 1.6?

Any help would be appreciated.

Thanks,
Charlie

danielmfreitas
Offline
Joined: 2005-03-02
Points: 0

I'm sorry kohsuke but I don't agree with you about maven fetching the correct dependencies. Ever since I had to switch from CXF to Jax-ws RI I'm having headaches to set it up properly with Spring (as someone else pointed out, one error after another).

The sample code is outdated, the documentation is lacking more information and I couldn't find answers to problems in jax-ws RI site or forums.

As of now I am having the same unsolved problem some other users have pointed out: I'm getting java.lang.NoClassDefFoundError: com/sun/istack/XMLStreamReaderToContentHandler error when my WS is called (the wsdl shows fine).

In my pom.xml I'm using


org.jvnet.jax-ws-commons.spring
jaxws-spring
1.7


com.sun.xml.ws
jaxws-rt
2.1.2

So please, please, please. Can someone point out what jar has this class. If we at least know which project this class belongs to we might find out how to set-up the correct dependencies in maven.

Posted edited after chilling out. /rant turned off :P

Message was edited by: danielmfreitas

danielmfreitas
Offline
Joined: 2005-03-02
Points: 0

Hey.

After a fun time checking inside the jars from the jax-ws implementation I found out that the needed jar is jaxb-impl.jar, from RI 2.1.2. This jar does have the class I'm looking for. After I copied the jar to my webapp lib folder, I noticed that there is a jaxb-impl-2.1.2.jar which DO NOT contain the missing class.

I dunno who is depending in this file: if it is a incorrect pom dependency for jax-ws or if it is another module or 3rd party library that needs that one and the dependency conflict resolver (whatever it is called) of maven selected this one.

I will try to find the correct version for jaxb-impl and see if I can tell maven to select this one over others.

Message was edited by: danielmfreitas

danielmfreitas
Offline
Joined: 2005-03-02
Points: 0

Ok. Reading the MANIFEST.MF file from jaxb-impl.jar that comes with RI 2.1.2, I think the version needed is jaxb-impl-2.1.4.

On, https://maven-repository.dev.java.net/nonav/repository/, there is a couple of versions. I checked the 2.1.4 version and the class was there. There are some more recent versions but I didn't bother checking.

I could successfully run the test now. By the way, I checked the jaxws-spring-1.7.pom file and look what I found:


com.sun.xml.bind
jaxb-impl
2.1.2

Indeed, jax-ws did not set up the dependencies properly (or maybe the jar was updated but not the pom).

So i fixed it myself to


com.sun.xml.bind
jaxb-impl
2.1.4

So I don't have to explicitly add that dependency to my project's pom.

Message was edited by: danielmfreitas

foxdeath
Offline
Joined: 2006-03-07
Points: 0

Yeah, I am having the exact same issue as 'artsu'. Any word on that fix?

artsu
Offline
Joined: 2007-05-02
Points: 0

Hello,

I have this strange error. Everything actually works for me, but not all in our team.
I am running the application in Linux, but I have successfully run the application on Windows as well.
We are using versions spring 2.06, jaxws-spring 1.6, jaxb-api 2.1, jaxws-api 2.1, jaxws-rt EA3, tomcat 5.5.23.
My locale (LANG) is en_US.
The team is in Russia so this could be an issue with computer's locale, though I changed my locale to Russian but still didn't have the problem.
A clip from context xml:




web.xml:


jaxws-servlet
com.sun.xml.ws.transport.http.servlet.WSSpringServlet


jaxws-servlet
/services/import

So the problem: When deploying the error message is as follows:
-----
2007-09-25 13:07:56,343 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/MMa]] -
instance of class org.springframework.web.context.ContextLoaderListener>
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'MMa_binding_for_import' defined in ServletContext res
WsContext.xml]: Cannot create inner bean '(inner bean)' of type
[org.jvnet.jax_ws_commons.spring.SpringService] while setting bean
property '
ception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)#1': FactoryBean threw
excepti
on; nested exception is [failed to localize]
nestedModelerError(com.sun.xml.ws.util.localization.LocalizableMessage@1
d7bd04)
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name '(inner bean)#1': FactoryBean threw exception on objec
exception is [failed to localize]
nestedModelerError(com.sun.xml.ws.util.localization.LocalizableMessage@1
d7bd04)
Caused by:
[failed to localize]
nestedModelerError(com.sun.xml.ws.util.localization.LocalizableMessage@1
d7bd04)
at
com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:276)
at
com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModel
er.java:573)
at
com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:52
0)
at
com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:361
)
at
com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.jav
a:247)
at
com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.jav
a:266)
at
com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.jav
a:174)
at
com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
at
org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.ja
va:317)
at
org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.ja
va:44)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectF
romFactoryBean(AbstractBeanFactory.java:1236)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectF
orBeanInstance(AbstractBeanFactory.java:1207)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveInnerBean(BeanDefinitionValueResolver.java:219)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.re
solveValueIfNecessary(BeanDefinitionValueResolver.java:127
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.applyPropertyValues(AbstractAutowireCapableBeanFactor
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.populateBean(AbstractAutowireCapableBeanFactory.java:
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:42
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
InstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContex
t(ContextLoader.java:244)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(
ContextLoader.java:187)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized
(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.j
ava:3763)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4211
)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:759)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31
0)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:119)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at
org.apache.catalina.core.StandardService.start(StandardService.java:450)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
25.9.2007 13:07:56 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
25.9.2007 13:07:56 org.apache.catalina.core.StandardContext start
SEVERE: Context [/MMa] startup failed due to previous errors

----

Any ideas where the problem lies? Any help highly appreciated.
Thanks.

ekkelenkamp
Offline
Joined: 2007-09-17
Points: 0

Hi,

I'v been trying out the jmaki-demo-app from the source code and I'm able to get the application running, only the dependency injection of Spring doesn't seem to work.
Should this example work?
In this example a greeter service is used where a property is used to set the prefix. This property is never set when I run the example.

The example can be found in:

jax-ws-commons\json\jmaki-demo-app

It would be nice to see an example with some actual injection of a spring bean or property.
Are there any suggestions on how to get this example running?

cheers,

Rudie.

craty
Offline
Joined: 2007-09-24
Points: 0

I am trying to implement the sample project given at https://jax-ws-commons.dev.java.net/source/browse/jax-ws-commons/trunk/s... to get jax-ws running. But I am getting this error : -
java.lang.NoClassDefFoundError: com/sun/xml/ws/transport/http/servlet/ServletAdapterList

I have included jaxws-spring-1.7.jar and xbean-spring-2.8.jar files in the project.

What else jar files I need to include?

tomjmul
Offline
Joined: 2007-09-05
Points: 0

Sorry for double posting, perhaps I should have posted this question here.....

I have successfully got the spring / jax-ws integration working with the jaxws-spring library. The problem now is that I am having trouble introducing AOP into the mix. The idea is that I would like some logging and performance measurement x-cutting 'around' code executed in each of my service implementation methods.

If I define any AOP configuration anywhere, even completely unrelated to the service classes, I get the trace (below) when deploying from eclipse:

---snip----



expression="execution(* Entry*.*(..))"/>


---snip----

After doing a little bit of digging, I find that when I include this snippet, the setService() method in SpringBinding is being called (or at least would be if spring didn't detect the type incompatibilities) with a java.lang.reflect.Method which is a referencing the aspect method:

server.aspect.WSRequestAuthenticationAspect.log(org.aspectj.lang.ProceedingJoinPoint) throws java.lang.Throwable

This is way over my head and I would be delighted if somebody could help out........kohsuke???

PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service': no matching editors or conversion strategy found
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wss:binding#246ffc' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service': no matching editors or conversion strategy found
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service': no matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.reflect.Method] to required type [com.sun.xml.ws.api.server.WSEndpoint] for property 'service': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1126)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:215)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:131)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
05-Sep-2007 14:18:58 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
05-Sep-2007 14:18:58 org.apache.catalina.core.StandardContext start
SEVERE: Context [/wsapi] startup failed due to previous errors
05-Sep-2007 14:18:59 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
05-Sep-2007 14:18:59 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
05-Sep-2007 14:18:59 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
05-Sep-2007 14:19:00 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/297 config=null
05-Sep-2007 14:19:00 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
05-Sep-2007 14:19:00 org.apache.catalina.startup.Catalina start
INFO: Server startup in 20422 ms

najmi
Offline
Joined: 2003-06-17
Points: 0

Hi Kohsuke,

I am just beginning to use jaxws-spring. It looks like just what I needed. Thank you.

One minor comment is on the choice of namespace prefixes below:

xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"

I think the names are not obvious and potentially misleading. WS implies web services to me while WSS implies Web Services Security. The current names threw me off briefly. Please consider a different choice. For example:

xmlns:jsic="http://jax-ws.dev.java.net/spring/core"
xmlns:jsis="http://jax-ws.dev.java.net/spring/servlet"

where:

jsic = JAX-WS Spring Integration - Core
jsis = JAX-WS Spring Integration - Servlet

Thanks again for this valuable work.

--
Regards,
Farrukh

kohsuke
Offline
Joined: 2003-06-09
Points: 0

jsic/jsis acronym expansion isn't very obvious to me.

How about just "c" and "s". They look sufficiently different, and don't collide with any existing acronyms.

artsu
Offline
Joined: 2007-05-02
Points: 0

..Deleted post.. issue solved and was due to external factors.

Message was edited by: artsu

willemsrb
Offline
Joined: 2007-02-08
Points: 0

About the JMS support... we have a little thing up and running here... i could give it as input if you like... it uses the JAX-WS spring integration as the main container and uses the spring message listener container to wrap around JAX-WS to get it to listen to JMS.. however it is quite specific for our project and probably full of bugs and loose ends... but if you are interested just reply and i'll post it here...

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I'm very interested!

mieleton
Offline
Joined: 2007-02-06
Points: 0

Hi!

I'm trying to get the jaxws-spring combination to work.

Am using I am using Spring 2.0.7, jboss-4.0.5.GA, JAXWS2.1.1_20070501.jar and jaxws-spring-1.4.jar.

applicationContext namespace definitions:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://jax-ws.dev.java.net/spring/core https://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet https://jax-ws.dev.java.net/spring/servlet.xsd">

When I startup the JBoss, following error occurs:

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://jax-ws.dev.java.net/spring/servlet]
Offending resource: class path resource [applicationContext.xml]

at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:261)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1111)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:91)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:75)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:65)
at fi.teligent.provisioning.ws.ApplicationContextUtil.(Unknown Source)
... 149 more

first of all, when I try to access the servlet namespace schema shown in the example on how to configure this jaxws-spring (http://jax-ws.dev.java.net/spring/servlet.xsd), it is not found. With using https instead I can access it.

But I can't figure out the correct combination of how to use the namespace definitions to get this working?

One other person has this same problem: http://forums.java.net/jive/thread.jspa?messageID=220668&tstart=0

willemsrb
Offline
Joined: 2007-02-08
Points: 0

Hi,

we ussually got this error when we didn't have the XBEAN library as a dependency.. maybe the same for you?

Regards,
Robert

mieleton
Offline
Joined: 2007-02-06
Points: 0

Ok... Is it part of JAX-WS or some other framework?

Could you point me towards that jar, as I haven't got the foggiest where to get it ;)

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I use Maven and that fetches all the necessary jars for us.

I think we need to provide all-in-one download zip file for non-Maven users...

gpinkham
Offline
Joined: 2007-07-30
Points: 0

Did the all in one archive ever happen? We can't seem to get past the namespace handler error and I believe we have the correct xbean jars.. (but then again I could be mistaken!!)

Thanks!
Gary

keithwillard
Offline
Joined: 2007-04-10
Points: 0

Is it expected that I can use the Spring support in JAX-WS to work with the JMS custom transport framework as is?

--Keith

kohsuke
Offline
Joined: 2003-06-09
Points: 0

Actually, no. JMS transport predates our Spring support, and it needs some love right now.

If you can file an issue for this so that this won't fall through the cracks, that would be great.

artsu
Offline
Joined: 2007-05-02
Points: 0

Hello,

I want to implement web services with jax-ws 2. The project needing web services is being developed with Spring framework.
Being new to web services I first implemented a simple web service with jax-ws without Spring. The application server is Tomcat 5.5 and the SDK is Java 5. All went quite nicely and I am happy how easily the web services can be implemented with jax-ws and with standard libraries.

But the problems started when I moved the implementation to the Spring framework. I followed the instructions in https://jax-ws-commons.dev.java.net/spring/ and used the jaxws-spring extension 1.4. There seem to be a lot of undocumented dependencies and I constantly have to find the newest (unstable) libraries. After solving one problem, I run into another. The latest one for example is
"java.lang.NoClassDefFoundError: com/sun/istack/XMLStreamReaderToContentHandler" (with jaxws-rt version 2.1.2-SNAPSHOT - needed because some other problem).

So my question in the end is: can I implement jax-ws 2.0 (or 2.1) web services with Spring framework without jaxws-spring extension and how?

Thank you.

-------
Not that relevant anymore, see http://forums.java.net/jive/message.jspa?messageID=215484#215484
instead.

Message was edited by: artsu

kohsuke
Offline
Joined: 2003-06-09
Points: 0

I hear your pain. Some of us are trying to create a single download or "uberjar" that contains all the stuff you need. I guess you could have greatly benefited from that, right?

I'll pass this input along. I think we really need to do it.