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
> [email protected]
> 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.

Reply via email to