You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Krzysztof Malinowski <km...@toya.net.pl> on 2010/02/22 16:32:22 UTC

MTOM difference of results

Hi,

I my previous post I notified problem shortly. Let me add some details.
I observed some different results, when I turn on my service, which exposes
some data based on MTOM.

One, correct if I turned on service via JaxWsServerFactoryBean (we can
simply say in native CXF way).
And, wrong if I do the same in Spring environment. 

In the second case I can't get any data, even some simple, outside MTOM
mechanism. I notice the begin of exception stack like this:

(...)
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/mail/util/LineInputStream
	at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:321)
	at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:301)
(...)

During the test I have set it up the logging interceptors, so inside the
inInterceptor I notice interested part of respose message, but with some
additional binary part.

In the first way, when I started service without Spring the entry of log was
clear.

Obviouslly, in both tests I based on the same SEI and its implementation
class.

Regards
Krzysztof
-- 
View this message in context: http://old.nabble.com/MTOM-difference-of-results-tp27689060p27689060.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: MTOM difference of results

Posted by Krzysztof Malinowski <km...@toya.net.pl>.
Thank for some tips!

I separated my service client from EE environment, then correct CXF jars was
used.
In this case I got result without any exceptions, but some strange.

When I turned on service inside Spring when I tried to process DataHandler
on client side I had some empty
stream (size of bytes 0)

If I turned on the same service without Spring as light server, then on
client side processing DataHandler got expectated result - stream had some
entry.

Below I put the significant part, preparing the stream on server side:
(...)
import javax.activation.DataHandler;
import javax.jws.WebService;

import com.sun.xml.internal.ws.util.ByteArrayDataSource;

@WebService(endpointInterface="mtom.test.IDocService")
public class DocServiceImpl implements IDocService {

	@Override
	public Document document() {
		// TODO Auto-generated method stub
		final String DATA = "<html><body><h1>Hello John B.</h1></body></html>";
		ByteArrayDataSource source = new ByteArrayDataSource(DATA.getBytes(),
"text/html");
		Document doc = new Document("text/html", new DataHandler(source));
		return doc;
	}

}
(...)

What's going on?



dkulp wrote:
> 
> 
> This sounds like a Mail provider issue of some sort.   We generally ship
> (and 
> use) the geronimo-mail jar (geronimo-javamail_1.4_spec-1.6.jar) and the 
> InternetHeaders object in there wouldn't be using the com/sun stuff.   It 
> looks like you are picking up a different mail jar and thus 
> config/classloaders or similar may be different.   My suggestion would be
> to 
> check your classpath and such for various mail jars.
> 
> Dan
> 
> 
> On Mon February 22 2010 10:32:22 am Krzysztof Malinowski wrote:
>> Hi,
>> 
>> I my previous post I notified problem shortly. Let me add some details.
>> I observed some different results, when I turn on my service, which
>> exposes
>> some data based on MTOM.
>> 
>> One, correct if I turned on service via JaxWsServerFactoryBean (we can
>> simply say in native CXF way).
>> And, wrong if I do the same in Spring environment.
>> 
>> In the second case I can't get any data, even some simple, outside MTOM
>> mechanism. I notice the begin of exception stack like this:
>> 
>> (...)
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> com/sun/mail/util/LineInputStream
>> 	at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:321)
>> 	at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:301)
>> (...)
>> 
>> During the test I have set it up the logging interceptors, so inside the
>> inInterceptor I notice interested part of respose message, but with some
>> additional binary part.
>> 
>> In the first way, when I started service without Spring the entry of log
>> was clear.
>> 
>> Obviouslly, in both tests I based on the same SEI and its implementation
>> class.
>> 
>> Regards
>> Krzysztof
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/MTOM-difference-of-results-tp27689060p27702062.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: MTOM difference of results

Posted by Krzysztof Malinowski <km...@toya.net.pl>.
Hi,

I done some more detailed excercises in meantime. Well the difference is:
in order to start the light version of server using JaxWsServerFactoryBean.
then we use only MTOM.

But in order to start server using Spring framework, then is more complex
variant
MTOM + XOP as default.

In this case I have two questions:
  - How can I set in Spring only MTOM ?
  - Haw can I tell (mens can set) the cxf client that the SOAP response is
more complicated, where is
    both XOP + MTOM ? Because client is set as default for parsing simply
MTOM (without XOP)

Sincerely
KM



dkulp wrote:
> 
> 
> This sounds like a Mail provider issue of some sort.   We generally ship
> (and 
> use) the geronimo-mail jar (geronimo-javamail_1.4_spec-1.6.jar) and the 
> InternetHeaders object in there wouldn't be using the com/sun stuff.   It 
> looks like you are picking up a different mail jar and thus 
> config/classloaders or similar may be different.   My suggestion would be
> to 
> check your classpath and such for various mail jars.
> 
> Dan
> 
> 
> On Mon February 22 2010 10:32:22 am Krzysztof Malinowski wrote:
>> Hi,
>> 
>> I my previous post I notified problem shortly. Let me add some details.
>> I observed some different results, when I turn on my service, which
>> exposes
>> some data based on MTOM.
>> 
>> One, correct if I turned on service via JaxWsServerFactoryBean (we can
>> simply say in native CXF way).
>> And, wrong if I do the same in Spring environment.
>> 
>> In the second case I can't get any data, even some simple, outside MTOM
>> mechanism. I notice the begin of exception stack like this:
>> 
>> (...)
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> com/sun/mail/util/LineInputStream
>> 	at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:321)
>> 	at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:301)
>> (...)
>> 
>> During the test I have set it up the logging interceptors, so inside the
>> inInterceptor I notice interested part of respose message, but with some
>> additional binary part.
>> 
>> In the first way, when I started service without Spring the entry of log
>> was clear.
>> 
>> Obviouslly, in both tests I based on the same SEI and its implementation
>> class.
>> 
>> Regards
>> Krzysztof
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/MTOM-difference-of-results-tp27689060p27704888.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: MTOM difference of results

Posted by Daniel Kulp <dk...@apache.org>.
This sounds like a Mail provider issue of some sort.   We generally ship (and 
use) the geronimo-mail jar (geronimo-javamail_1.4_spec-1.6.jar) and the 
InternetHeaders object in there wouldn't be using the com/sun stuff.   It 
looks like you are picking up a different mail jar and thus 
config/classloaders or similar may be different.   My suggestion would be to 
check your classpath and such for various mail jars.

Dan


On Mon February 22 2010 10:32:22 am Krzysztof Malinowski wrote:
> Hi,
> 
> I my previous post I notified problem shortly. Let me add some details.
> I observed some different results, when I turn on my service, which exposes
> some data based on MTOM.
> 
> One, correct if I turned on service via JaxWsServerFactoryBean (we can
> simply say in native CXF way).
> And, wrong if I do the same in Spring environment.
> 
> In the second case I can't get any data, even some simple, outside MTOM
> mechanism. I notice the begin of exception stack like this:
> 
> (...)
> Exception in thread "main" java.lang.NoClassDefFoundError:
> com/sun/mail/util/LineInputStream
> 	at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:321)
> 	at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:301)
> (...)
> 
> During the test I have set it up the logging interceptors, so inside the
> inInterceptor I notice interested part of respose message, but with some
> additional binary part.
> 
> In the first way, when I started service without Spring the entry of log
> was clear.
> 
> Obviouslly, in both tests I based on the same SEI and its implementation
> class.
> 
> Regards
> Krzysztof

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog