calling wbeservice with axis

View: New views
11 Messages — Rating Filter:   Alert me  

calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I try to invoke the webservice call implemented in java(I converted the java code into dll).
I got the following error:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain
 at javax.activation.DataHandler.getInputStream(DataHandler.java:248)
 at javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:703)
 at org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:73)
 at org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:38)
 at org.apache.axis.attachments.AttachmentsImpl.getContentLength(AttachmentsImpl.java:438)
 at org.apache.axis.Message.getContentLength(Message.java:512)
 at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:371)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:33)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)

I did some research.
It looks like the axis.jar is loaded via ikvm.runtime.AssemblyClassLoader, however, the javax.activation.DataHandler( I believe it is implemented in IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.

Is it possible to have loaded them in the same classloader?
Or is there other way to handle this?

Thanks,
Jun

Re: calling wbeservice with axis

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

The class loader of javax.activation.DataHandler is null (aka the bootstrap class loader). In IKVM.NET you cannot add stuff to the boot class path (except by recompiling the boot class library), but I seriously doubt that's necessary. Most code in the boot class library uses either the system or the thread context class loader.

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 4:15 PM
> To: ikvm-developers@...
> Subject: [Ikvm-developers] calling wbeservice with axis
>
>
> Hi,
>
> I try to invoke the webservice call implemented in java(I converted the
> java code into dll).
> I got the following error:
> javax.activation.UnsupportedDataTypeException: no object DCH for MIME
> type text/plain  at
> javax.activation.DataHandler.getInputStream(DataHandler.java:248)
>  at
> javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:
> 703)
>  at
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:7
> 3)
>  at
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:3
> 8)
>  at
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachment
> sImpl.java:438)
>  at org.apache.axis.Message.getContentLength(Message.java:512)
>  at
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java
> :371)
>  at
> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
>  at
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.
> java:33)
>  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
>  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
>  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
>  at org.apache.axis.client.Call.invoke(Call.java:2767)
>  at org.apache.axis.client.Call.invoke(Call.java:2443)
>  at org.apache.axis.client.Call.invoke(Call.java:2366)
>  at org.apache.axis.client.Call.invoke(Call.java:1812)
>
> I did some research.
> It looks like the axis.jar is loaded via
> ikvm.runtime.AssemblyClassLoader, however, the
> javax.activation.DataHandler( I believe it is implemented in
> IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
>
> Is it possible to have loaded them in the same classloader?
> Or is there other way to handle this?
>
> Thanks,
> Jun
> --
> View this message in context: http://old.nabble.com/calling-wbeservice-
> with-axis-tp26230793p26230793.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

Yes, you are right. The class loader of javax.activation.DataHandler is
null and it is bootstrap class loader.
Just wondering how can I add/recompile the axis.jar in the boot class
library. (I know it is awful).
Otherwise, not sure if anyone else used the axis via IKVM since I don't
really want to rewrite those web service code in c#.

Thanks,
Jun

-----Original Message-----
From: Jeroen Frijters [mailto:jeroen@...]
Sent: Friday, November 06, 2009 10:33 AM
To: Li, Jun; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi,

The class loader of javax.activation.DataHandler is null (aka the
bootstrap class loader). In IKVM.NET you cannot add stuff to the boot
class path (except by recompiling the boot class library), but I
seriously doubt that's necessary. Most code in the boot class library
uses either the system or the thread context class loader.

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 4:15 PM
> To: ikvm-developers@...
> Subject: [Ikvm-developers] calling wbeservice with axis
>
>
> Hi,
>
> I try to invoke the webservice call implemented in java(I converted
> the java code into dll).
> I got the following error:
> javax.activation.UnsupportedDataTypeException: no object DCH for MIME
> type text/plain  at
> javax.activation.DataHandler.getInputStream(DataHandler.java:248)
>  at
>
javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:

> 703)
>  at
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> 7
> 3)
>  at
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> 3
> 8)
>  at
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> t
> sImpl.java:438)
>  at org.apache.axis.Message.getContentLength(Message.java:512)
>  at
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> a
> :371)
>  at
> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
>  at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.

> java:33)
>  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
>  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
>  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
>  at org.apache.axis.client.Call.invoke(Call.java:2767)
>  at org.apache.axis.client.Call.invoke(Call.java:2443)
>  at org.apache.axis.client.Call.invoke(Call.java:2366)
>  at org.apache.axis.client.Call.invoke(Call.java:1812)
>
> I did some research.
> It looks like the axis.jar is loaded via
> ikvm.runtime.AssemblyClassLoader, however, the
> javax.activation.DataHandler( I believe it is implemented in
> IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
>
> Is it possible to have loaded them in the same classloader?
> Or is there other way to handle this?
>
> Thanks,
> Jun
> --
> View this message in context:
> http://old.nabble.com/calling-wbeservice-
> with-axis-tp26230793p26230793.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> ----------------------------------------------------------------------
> -
> -------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day trial. Simplify your report design, integration and deployment
> - and focus on what you do best, core application coding. Discover
> what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july 
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 ===============================================================================
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just another thought, is there any old version of IKVM which does not
include activation in the boot library?
I can build activation.jar and axis.jar in the same assembly.

-----Original Message-----
From: Li, Jun
Sent: Friday, November 06, 2009 10:43 AM
To: 'Jeroen Frijters'; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi Jeroen,

Yes, you are right. The class loader of javax.activation.DataHandler is
null and it is bootstrap class loader.
Just wondering how can I add/recompile the axis.jar in the boot class
library. (I know it is awful).
Otherwise, not sure if anyone else used the axis via IKVM since I don't
really want to rewrite those web service code in c#.

Thanks,
Jun

-----Original Message-----
From: Jeroen Frijters [mailto:jeroen@...]
Sent: Friday, November 06, 2009 10:33 AM
To: Li, Jun; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi,

The class loader of javax.activation.DataHandler is null (aka the
bootstrap class loader). In IKVM.NET you cannot add stuff to the boot
class path (except by recompiling the boot class library), but I
seriously doubt that's necessary. Most code in the boot class library
uses either the system or the thread context class loader.

Regards,
Jeroen

> -----Original Message-----
> From: jun_li [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 4:15 PM
> To: ikvm-developers@...
> Subject: [Ikvm-developers] calling wbeservice with axis
>
>
> Hi,
>
> I try to invoke the webservice call implemented in java(I converted
> the java code into dll).
> I got the following error:
> javax.activation.UnsupportedDataTypeException: no object DCH for MIME
> type text/plain  at
> javax.activation.DataHandler.getInputStream(DataHandler.java:248)
>  at
>
javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:

> 703)
>  at
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> 7
> 3)
>  at
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> 3
> 8)
>  at
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> t
> sImpl.java:438)
>  at org.apache.axis.Message.getContentLength(Message.java:512)
>  at
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> a
> :371)
>  at
> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
>  at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.

> java:33)
>  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
>  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
>  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
>  at org.apache.axis.client.Call.invoke(Call.java:2767)
>  at org.apache.axis.client.Call.invoke(Call.java:2443)
>  at org.apache.axis.client.Call.invoke(Call.java:2366)
>  at org.apache.axis.client.Call.invoke(Call.java:1812)
>
> I did some research.
> It looks like the axis.jar is loaded via
> ikvm.runtime.AssemblyClassLoader, however, the
> javax.activation.DataHandler( I believe it is implemented in
> IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
>
> Is it possible to have loaded them in the same classloader?
> Or is there other way to handle this?
>
> Thanks,
> Jun
> --
> View this message in context:
> http://old.nabble.com/calling-wbeservice-
> with-axis-tp26230793p26230793.html
> Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
>
>
> ----------------------------------------------------------------------
> -
> -------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day trial. Simplify your report design, integration and deployment
> - and focus on what you do best, core application coding. Discover
> what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july 
> _______________________________________________
> Ikvm-developers mailing list
> Ikvm-developers@...
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 ===============================================================================
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jun,

Why not simply make sure that the axis assembly is reachable via the system class loader?

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 4:43 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> Yes, you are right. The class loader of javax.activation.DataHandler is
> null and it is bootstrap class loader.
> Just wondering how can I add/recompile the axis.jar in the boot class
> library. (I know it is awful).
> Otherwise, not sure if anyone else used the axis via IKVM since I don't
> really want to rewrite those web service code in c#.
>
> Thanks,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 10:33 AM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi,
>
> The class loader of javax.activation.DataHandler is null (aka the
> bootstrap class loader). In IKVM.NET you cannot add stuff to the boot
> class path (except by recompiling the boot class library), but I
> seriously doubt that's necessary. Most code in the boot class library
> uses either the system or the thread context class loader.
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: jun_li [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 4:15 PM
> > To: ikvm-developers@...
> > Subject: [Ikvm-developers] calling wbeservice with axis
> >
> >
> > Hi,
> >
> > I try to invoke the webservice call implemented in java(I converted
> > the java code into dll).
> > I got the following error:
> > javax.activation.UnsupportedDataTypeException: no object DCH for MIME
> > type text/plain  at
> > javax.activation.DataHandler.getInputStream(DataHandler.java:248)
> >  at
> >
> javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:
> > 703)
> >  at
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > 7
> > 3)
> >  at
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > 3
> > 8)
> >  at
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > t
> > sImpl.java:438)
> >  at org.apache.axis.Message.getContentLength(Message.java:512)
> >  at
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > a
> > :371)
> >  at
> > org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
> >  at
> >
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.
> > java:33)
> >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> >  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> >
> > I did some research.
> > It looks like the axis.jar is loaded via
> > ikvm.runtime.AssemblyClassLoader, however, the
> > javax.activation.DataHandler( I believe it is implemented in
> > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> >
> > Is it possible to have loaded them in the same classloader?
> > Or is there other way to handle this?
> >
> > Thanks,
> > Jun
> > --
> > View this message in context:
> > http://old.nabble.com/calling-wbeservice-
> > with-axis-tp26230793p26230793.html
> > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> -
> > -
> > -------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> > 30-Day trial. Simplify your report design, integration and deployment
> > - and focus on what you do best, core application coding. Discover
> > what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > Ikvm-developers mailing list
> > Ikvm-developers@...
> > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>
> =======================================================================
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> =======================================================================
> ========
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

I thought that the cause of the problem is that those two jar files
(activation.jar and axis.jar) are NOT in the same classloader.
Currently, the axis is loaded in system class loader (I guess the
AssemblyClassLoader is the default one).

Thanks,
Jun

-----Original Message-----
From: Jeroen Frijters [mailto:jeroen@...]
Sent: Friday, November 06, 2009 10:53 AM
To: Li, Jun; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi Jun,

Why not simply make sure that the axis assembly is reachable via the
system class loader?

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 4:43 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> Yes, you are right. The class loader of javax.activation.DataHandler
> is null and it is bootstrap class loader.
> Just wondering how can I add/recompile the axis.jar in the boot class
> library. (I know it is awful).
> Otherwise, not sure if anyone else used the axis via IKVM since I
> don't really want to rewrite those web service code in c#.
>
> Thanks,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 10:33 AM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi,
>
> The class loader of javax.activation.DataHandler is null (aka the
> bootstrap class loader). In IKVM.NET you cannot add stuff to the boot
> class path (except by recompiling the boot class library), but I
> seriously doubt that's necessary. Most code in the boot class library
> uses either the system or the thread context class loader.
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: jun_li [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 4:15 PM
> > To: ikvm-developers@...
> > Subject: [Ikvm-developers] calling wbeservice with axis
> >
> >
> > Hi,
> >
> > I try to invoke the webservice call implemented in java(I converted
> > the java code into dll).
> > I got the following error:
> > javax.activation.UnsupportedDataTypeException: no object DCH for
> > MIME type text/plain  at
> > javax.activation.DataHandler.getInputStream(DataHandler.java:248)
> >  at
> >
>
javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:

> > 703)
> >  at
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > 7
> > 3)
> >  at
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > 3
> > 8)
> >  at
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > t
> > sImpl.java:438)
> >  at org.apache.axis.Message.getContentLength(Message.java:512)
> >  at
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > a
> > :371)
> >  at
> > org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138
> > )
> >  at
> >
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.

> > java:33)
> >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> >  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> >
> > I did some research.
> > It looks like the axis.jar is loaded via
> > ikvm.runtime.AssemblyClassLoader, however, the
> > javax.activation.DataHandler( I believe it is implemented in
> > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> >
> > Is it possible to have loaded them in the same classloader?
> > Or is there other way to handle this?
> >
> > Thanks,
> > Jun
> > --
> > View this message in context:
> > http://old.nabble.com/calling-wbeservice-
> > with-axis-tp26230793p26230793.html
> > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
> >
> >
> > --------------------------------------------------------------------
> > -
> -
> > -
> > -------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008

> > 30-Day trial. Simplify your report design, integration and
> > deployment
> > - and focus on what you do best, core application coding. Discover
> > what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july 
> > _______________________________________________
> > Ikvm-developers mailing list
> > Ikvm-developers@...
> > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>
> ======================================================================
> =
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> ======================================================================
> =
> ========
>

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 ===============================================================================
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jun,

No. javax.activation uses the system class loader. The attached example shows that and it also shows how you can change the system class loader.

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 5:00 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> I thought that the cause of the problem is that those two jar files
> (activation.jar and axis.jar) are NOT in the same classloader.
> Currently, the axis is loaded in system class loader (I guess the
> AssemblyClassLoader is the default one).
>
> Thanks,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 10:53 AM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jun,
>
> Why not simply make sure that the axis assembly is reachable via the
> system class loader?
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: Li, Jun [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 4:43 PM
> > To: Jeroen Frijters; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jeroen,
> >
> > Yes, you are right. The class loader of javax.activation.DataHandler
> > is null and it is bootstrap class loader.
> > Just wondering how can I add/recompile the axis.jar in the boot class
> > library. (I know it is awful).
> > Otherwise, not sure if anyone else used the axis via IKVM since I
> > don't really want to rewrite those web service code in c#.
> >
> > Thanks,
> > Jun
> >
> > -----Original Message-----
> > From: Jeroen Frijters [mailto:jeroen@...]
> > Sent: Friday, November 06, 2009 10:33 AM
> > To: Li, Jun; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi,
> >
> > The class loader of javax.activation.DataHandler is null (aka the
> > bootstrap class loader). In IKVM.NET you cannot add stuff to the boot
> > class path (except by recompiling the boot class library), but I
> > seriously doubt that's necessary. Most code in the boot class library
> > uses either the system or the thread context class loader.
> >
> > Regards,
> > Jeroen
> >
> > > -----Original Message-----
> > > From: jun_li [mailto:jun.li@...]
> > > Sent: Friday, November 06, 2009 4:15 PM
> > > To: ikvm-developers@...
> > > Subject: [Ikvm-developers] calling wbeservice with axis
> > >
> > >
> > > Hi,
> > >
> > > I try to invoke the webservice call implemented in java(I converted
> > > the java code into dll).
> > > I got the following error:
> > > javax.activation.UnsupportedDataTypeException: no object DCH for
> > > MIME type text/plain  at
> > > javax.activation.DataHandler.getInputStream(DataHandler.java:248)
> > >  at
> > >
> >
> javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:
> > > 703)
> > >  at
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > 7
> > > 3)
> > >  at
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > 3
> > > 8)
> > >  at
> > >
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > > t
> > > sImpl.java:438)
> > >  at org.apache.axis.Message.getContentLength(Message.java:512)
> > >  at
> > >
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > > a
> > > :371)
> > >  at
> > >
> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138
> > > )
> > >  at
> > >
> >
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.
> > > java:33)
> > >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> > >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> > >  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> > >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> > >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> > >
> > > I did some research.
> > > It looks like the axis.jar is loaded via
> > > ikvm.runtime.AssemblyClassLoader, however, the
> > > javax.activation.DataHandler( I believe it is implemented in
> > > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> > >
> > > Is it possible to have loaded them in the same classloader?
> > > Or is there other way to handle this?
> > >
> > > Thanks,
> > > Jun
> > > --
> > > View this message in context:
> > > http://old.nabble.com/calling-wbeservice-
> > > with-axis-tp26230793p26230793.html
> > > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
> > >
> > >
> > > -------------------------------------------------------------------
> -
> > > -
> > -
> > > -
> > > -------
> > > Let Crystal Reports handle the reporting - Free Crystal Reports
> 2008
>
> > > 30-Day trial. Simplify your report design, integration and
> > > deployment
> > > - and focus on what you do best, core application coding. Discover
> > > what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> > > _______________________________________________
> > > Ikvm-developers mailing list
> > > Ikvm-developers@...
> > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
> >
> >
> ======================================================================
> > =
> > ========
> >  Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> >
> ======================================================================
> > =
> > ========
> >
>
> =======================================================================
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> =======================================================================
> ========
>

using System;

public class Program : java.lang.ClassLoader
{
        public Program(java.lang.ClassLoader parent)
                : base(parent)
        {
        }

        protected override java.net.URL findResource(string name)
        {
                Console.WriteLine(name);
                return base.findResource(name);
        }

        static void Main(string[] args)
        {
                java.lang.System.setProperty("java.system.class.loader", typeof(Program).AssemblyQualifiedName);
                javax.activation.DataHandler dh = new javax.activation.DataHandler("foo", "text/plain");
                dh.getInputStream();
        }
}

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

Thank you so much for your kindly help and I understand your point now.
And I do have my own system classloader.
Anyway, I tried the code in a new project and I got the exactly error
message.
Just wondering if it is related with the version(0.40.0.1) I have.
Will try to download a new version...

Best regards and have a good weekend,
Jun

-----Original Message-----
From: Jeroen Frijters [mailto:jeroen@...]
Sent: Friday, November 06, 2009 3:18 PM
To: Li, Jun; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi Jun,

No. javax.activation uses the system class loader. The attached example
shows that and it also shows how you can change the system class loader.

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 5:00 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> I thought that the cause of the problem is that those two jar files
> (activation.jar and axis.jar) are NOT in the same classloader.
> Currently, the axis is loaded in system class loader (I guess the
> AssemblyClassLoader is the default one).
>
> Thanks,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 10:53 AM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jun,
>
> Why not simply make sure that the axis assembly is reachable via the
> system class loader?
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: Li, Jun [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 4:43 PM
> > To: Jeroen Frijters; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jeroen,
> >
> > Yes, you are right. The class loader of javax.activation.DataHandler

> > is null and it is bootstrap class loader.
> > Just wondering how can I add/recompile the axis.jar in the boot
> > class library. (I know it is awful).
> > Otherwise, not sure if anyone else used the axis via IKVM since I
> > don't really want to rewrite those web service code in c#.
> >
> > Thanks,
> > Jun
> >
> > -----Original Message-----
> > From: Jeroen Frijters [mailto:jeroen@...]
> > Sent: Friday, November 06, 2009 10:33 AM
> > To: Li, Jun; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi,
> >
> > The class loader of javax.activation.DataHandler is null (aka the
> > bootstrap class loader). In IKVM.NET you cannot add stuff to the
> > boot class path (except by recompiling the boot class library), but
> > I seriously doubt that's necessary. Most code in the boot class
> > library uses either the system or the thread context class loader.
> >
> > Regards,
> > Jeroen
> >
> > > -----Original Message-----
> > > From: jun_li [mailto:jun.li@...]
> > > Sent: Friday, November 06, 2009 4:15 PM
> > > To: ikvm-developers@...
> > > Subject: [Ikvm-developers] calling wbeservice with axis
> > >
> > >
> > > Hi,
> > >
> > > I try to invoke the webservice call implemented in java(I
> > > converted the java code into dll).
> > > I got the following error:
> > > javax.activation.UnsupportedDataTypeException: no object DCH for
> > > MIME type text/plain  at
> > > javax.activation.DataHandler.getInputStream(DataHandler.java:248)
> > >  at
> > >
> >
>
javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:

> > > 703)
> > >  at
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > 7
> > > 3)
> > >  at
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > 3
> > > 8)
> > >  at
> > >
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > > t
> > > sImpl.java:438)
> > >  at org.apache.axis.Message.getContentLength(Message.java:512)
> > >  at
> > >
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > > a
> > > :371)
> > >  at
> > >
> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138
> > > )
> > >  at
> > >
> >
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.

> > > java:33)
> > >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> > >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> > >  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> > >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> > >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> > >
> > > I did some research.
> > > It looks like the axis.jar is loaded via
> > > ikvm.runtime.AssemblyClassLoader, however, the
> > > javax.activation.DataHandler( I believe it is implemented in
> > > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> > >
> > > Is it possible to have loaded them in the same classloader?
> > > Or is there other way to handle this?
> > >
> > > Thanks,
> > > Jun
> > > --
> > > View this message in context:
> > > http://old.nabble.com/calling-wbeservice-
> > > with-axis-tp26230793p26230793.html
> > > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
> > >
> > >
> > > ------------------------------------------------------------------
> > > -
> -
> > > -
> > -
> > > -
> > > -------
> > > Let Crystal Reports handle the reporting - Free Crystal Reports
> 2008
>
> > > 30-Day trial. Simplify your report design, integration and
> > > deployment
> > > - and focus on what you do best, core application coding. Discover

> > > what's new with Crystal Reports now.  
> > > http://p.sf.net/sfu/bobj-july 
> > > _______________________________________________
> > > Ikvm-developers mailing list
> > > Ikvm-developers@...
> > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
> >
> >
> ======================================================================
> > =
> > ========
> >  Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> >
> ======================================================================
> > =
> > ========
> >
>
> ======================================================================
> =
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> ======================================================================
> =
> ========
>

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 ===============================================================================
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks like I had the latest version :(.

-----Original Message-----
From: Li, Jun
Sent: Friday, November 06, 2009 4:23 PM
To: 'Jeroen Frijters'; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi Jeroen,

Thank you so much for your kindly help and I understand your point now.
And I do have my own system classloader.
Anyway, I tried the code in a new project and I got the exactly error
message.
Just wondering if it is related with the version(0.40.0.1) I have.
Will try to download a new version...

Best regards and have a good weekend,
Jun

-----Original Message-----
From: Jeroen Frijters [mailto:jeroen@...]
Sent: Friday, November 06, 2009 3:18 PM
To: Li, Jun; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

Hi Jun,

No. javax.activation uses the system class loader. The attached example
shows that and it also shows how you can change the system class loader.

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 5:00 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> I thought that the cause of the problem is that those two jar files
> (activation.jar and axis.jar) are NOT in the same classloader.
> Currently, the axis is loaded in system class loader (I guess the
> AssemblyClassLoader is the default one).
>
> Thanks,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 10:53 AM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jun,
>
> Why not simply make sure that the axis assembly is reachable via the
> system class loader?
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: Li, Jun [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 4:43 PM
> > To: Jeroen Frijters; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jeroen,
> >
> > Yes, you are right. The class loader of javax.activation.DataHandler

> > is null and it is bootstrap class loader.
> > Just wondering how can I add/recompile the axis.jar in the boot
> > class library. (I know it is awful).
> > Otherwise, not sure if anyone else used the axis via IKVM since I
> > don't really want to rewrite those web service code in c#.
> >
> > Thanks,
> > Jun
> >
> > -----Original Message-----
> > From: Jeroen Frijters [mailto:jeroen@...]
> > Sent: Friday, November 06, 2009 10:33 AM
> > To: Li, Jun; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi,
> >
> > The class loader of javax.activation.DataHandler is null (aka the
> > bootstrap class loader). In IKVM.NET you cannot add stuff to the
> > boot class path (except by recompiling the boot class library), but
> > I seriously doubt that's necessary. Most code in the boot class
> > library uses either the system or the thread context class loader.
> >
> > Regards,
> > Jeroen
> >
> > > -----Original Message-----
> > > From: jun_li [mailto:jun.li@...]
> > > Sent: Friday, November 06, 2009 4:15 PM
> > > To: ikvm-developers@...
> > > Subject: [Ikvm-developers] calling wbeservice with axis
> > >
> > >
> > > Hi,
> > >
> > > I try to invoke the webservice call implemented in java(I
> > > converted the java code into dll).
> > > I got the following error:
> > > javax.activation.UnsupportedDataTypeException: no object DCH for
> > > MIME type text/plain  at
> > > javax.activation.DataHandler.getInputStream(DataHandler.java:248)
> > >  at
> > >
> >
>
javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:

> > > 703)
> > >  at
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > 7
> > > 3)
> > >  at
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > 3
> > > 8)
> > >  at
> > >
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > > t
> > > sImpl.java:438)
> > >  at org.apache.axis.Message.getContentLength(Message.java:512)
> > >  at
> > >
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > > a
> > > :371)
> > >  at
> > >
> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138
> > > )
> > >  at
> > >
> >
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.

> > > java:33)
> > >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> > >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> > >  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> > >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> > >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> > >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> > >
> > > I did some research.
> > > It looks like the axis.jar is loaded via
> > > ikvm.runtime.AssemblyClassLoader, however, the
> > > javax.activation.DataHandler( I believe it is implemented in
> > > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> > >
> > > Is it possible to have loaded them in the same classloader?
> > > Or is there other way to handle this?
> > >
> > > Thanks,
> > > Jun
> > > --
> > > View this message in context:
> > > http://old.nabble.com/calling-wbeservice-
> > > with-axis-tp26230793p26230793.html
> > > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
> > >
> > >
> > > ------------------------------------------------------------------
> > > -
> -
> > > -
> > -
> > > -
> > > -------
> > > Let Crystal Reports handle the reporting - Free Crystal Reports
> 2008
>
> > > 30-Day trial. Simplify your report design, integration and
> > > deployment
> > > - and focus on what you do best, core application coding. Discover

> > > what's new with Crystal Reports now.
> > > http://p.sf.net/sfu/bobj-july
> > > _______________________________________________
> > > Ikvm-developers mailing list
> > > Ikvm-developers@...
> > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
> >
> >
> ======================================================================
> > =
> > ========
> >  Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> >
> ======================================================================
> > =
> > ========
> >
>
> ======================================================================
> =
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> ======================================================================
> =
> ========
>

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 ===============================================================================
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The sample I posted didn't solve the problem. It was only a hint on how to solve the problem. It shows that javax.activation uses the system class loader and that you need to set the system class loader to a class loader that knows how to load META-INF/mailcap (i.e. delegate to the axis assembly class loader).

I've attached something that should work. BTW, you must make sure that the java.system.class.loader system property is set before any other Java code executes, otherwise you run the risk of getting the default system class loader.

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 10:23 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> Thank you so much for your kindly help and I understand your point now.
> And I do have my own system classloader.
> Anyway, I tried the code in a new project and I got the exactly error
> message.
> Just wondering if it is related with the version(0.40.0.1) I have.
> Will try to download a new version...
>
> Best regards and have a good weekend,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 3:18 PM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jun,
>
> No. javax.activation uses the system class loader. The attached example
> shows that and it also shows how you can change the system class
> loader.
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: Li, Jun [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 5:00 PM
> > To: Jeroen Frijters; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jeroen,
> >
> > I thought that the cause of the problem is that those two jar files
> > (activation.jar and axis.jar) are NOT in the same classloader.
> > Currently, the axis is loaded in system class loader (I guess the
> > AssemblyClassLoader is the default one).
> >
> > Thanks,
> > Jun
> >
> > -----Original Message-----
> > From: Jeroen Frijters [mailto:jeroen@...]
> > Sent: Friday, November 06, 2009 10:53 AM
> > To: Li, Jun; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jun,
> >
> > Why not simply make sure that the axis assembly is reachable via the
> > system class loader?
> >
> > Regards,
> > Jeroen
> >
> > > -----Original Message-----
> > > From: Li, Jun [mailto:jun.li@...]
> > > Sent: Friday, November 06, 2009 4:43 PM
> > > To: Jeroen Frijters; ikvm-developers@...
> > > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> > >
> > > Hi Jeroen,
> > >
> > > Yes, you are right. The class loader of
> javax.activation.DataHandler
>
> > > is null and it is bootstrap class loader.
> > > Just wondering how can I add/recompile the axis.jar in the boot
> > > class library. (I know it is awful).
> > > Otherwise, not sure if anyone else used the axis via IKVM since I
> > > don't really want to rewrite those web service code in c#.
> > >
> > > Thanks,
> > > Jun
> > >
> > > -----Original Message-----
> > > From: Jeroen Frijters [mailto:jeroen@...]
> > > Sent: Friday, November 06, 2009 10:33 AM
> > > To: Li, Jun; ikvm-developers@...
> > > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> > >
> > > Hi,
> > >
> > > The class loader of javax.activation.DataHandler is null (aka the
> > > bootstrap class loader). In IKVM.NET you cannot add stuff to the
> > > boot class path (except by recompiling the boot class library), but
> > > I seriously doubt that's necessary. Most code in the boot class
> > > library uses either the system or the thread context class loader.
> > >
> > > Regards,
> > > Jeroen
> > >
> > > > -----Original Message-----
> > > > From: jun_li [mailto:jun.li@...]
> > > > Sent: Friday, November 06, 2009 4:15 PM
> > > > To: ikvm-developers@...
> > > > Subject: [Ikvm-developers] calling wbeservice with axis
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I try to invoke the webservice call implemented in java(I
> > > > converted the java code into dll).
> > > > I got the following error:
> > > > javax.activation.UnsupportedDataTypeException: no object DCH for
> > > > MIME type text/plain  at
> > > > javax.activation.DataHandler.getInputStream(DataHandler.java:248)
> > > >  at
> > > >
> > >
> >
> javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:
> > > > 703)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > > 7
> > > > 3)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > > 3
> > > > 8)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > > > t
> > > > sImpl.java:438)
> > > >  at org.apache.axis.Message.getContentLength(Message.java:512)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > > > a
> > > > :371)
> > > >  at
> > > >
> > org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138
> > > > )
> > > >  at
> > > >
> > >
> >
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.
> > > > java:33)
> > > >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> > > >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> > > >  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> > > >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> > > >
> > > > I did some research.
> > > > It looks like the axis.jar is loaded via
> > > > ikvm.runtime.AssemblyClassLoader, however, the
> > > > javax.activation.DataHandler( I believe it is implemented in
> > > > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> > > >
> > > > Is it possible to have loaded them in the same classloader?
> > > > Or is there other way to handle this?
> > > >
> > > > Thanks,
> > > > Jun
> > > > --
> > > > View this message in context:
> > > > http://old.nabble.com/calling-wbeservice-
> > > > with-axis-tp26230793p26230793.html
> > > > Sent from the IKVM .NET - Dev mailing list archive at Nabble.com.
> > > >
> > > >
> > > > -----------------------------------------------------------------
> -
> > > > -
> > -
> > > > -
> > > -
> > > > -
> > > > -------
> > > > Let Crystal Reports handle the reporting - Free Crystal Reports
> > 2008
> >
> > > > 30-Day trial. Simplify your report design, integration and
> > > > deployment
> > > > - and focus on what you do best, core application coding.
> Discover
>
> > > > what's new with Crystal Reports now.
> > > > http://p.sf.net/sfu/bobj-july
> > > > _______________________________________________
> > > > Ikvm-developers mailing list
> > > > Ikvm-developers@...
> > > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
> > >
> > >
> >
> ======================================================================
> > > =
> > > ========
> > >  Please access the attached hyperlink for an important electronic
> > > communications disclaimer:
> > >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > >
> > >
> >
> ======================================================================
> > > =
> > > ========
> > >
> >
> >
> ======================================================================
> > =
> > ========
> >  Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> >
> ======================================================================
> > =
> > ========
> >
>
> =======================================================================
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> =======================================================================
> ========
>

using System;

public class Program : java.lang.ClassLoader
{
        public Program(java.lang.ClassLoader parent)
                : base(GetClassLoader())
        {
        }

        private static java.lang.ClassLoader GetClassLoader()
        {
                java.lang.Class c = typeof(javax.mail.Message);
                return c.getClassLoader();
        }

        static void Main(string[] args)
        {
                java.lang.System.setProperty("java.system.class.loader", typeof(Program).AssemblyQualifiedName);
                javax.activation.DataHandler dh = new javax.activation.DataHandler("foo", "text/plain");
                dh.getInputStream();
        }
}

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: calling wbeservice with axis

by jun_li :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jeroen,

Great!
It is working after I managed to invoke a static method before the log4j
logger.

Really appreciated!

Best Regards,
Jun
 

-----Original Message-----
From: Jeroen Frijters [mailto:jeroen@...]
Sent: Saturday, November 07, 2009 2:45 AM
To: Li, Jun; ikvm-developers@...
Subject: RE: [Ikvm-developers] calling wbeservice with axis

The sample I posted didn't solve the problem. It was only a hint on how
to solve the problem. It shows that javax.activation uses the system
class loader and that you need to set the system class loader to a class
loader that knows how to load META-INF/mailcap (i.e. delegate to the
axis assembly class loader).

I've attached something that should work. BTW, you must make sure that
the java.system.class.loader system property is set before any other
Java code executes, otherwise you run the risk of getting the default
system class loader.

Regards,
Jeroen

> -----Original Message-----
> From: Li, Jun [mailto:jun.li@...]
> Sent: Friday, November 06, 2009 10:23 PM
> To: Jeroen Frijters; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jeroen,
>
> Thank you so much for your kindly help and I understand your point
now.

> And I do have my own system classloader.
> Anyway, I tried the code in a new project and I got the exactly error
> message.
> Just wondering if it is related with the version(0.40.0.1) I have.
> Will try to download a new version...
>
> Best regards and have a good weekend,
> Jun
>
> -----Original Message-----
> From: Jeroen Frijters [mailto:jeroen@...]
> Sent: Friday, November 06, 2009 3:18 PM
> To: Li, Jun; ikvm-developers@...
> Subject: RE: [Ikvm-developers] calling wbeservice with axis
>
> Hi Jun,
>
> No. javax.activation uses the system class loader. The attached
> example shows that and it also shows how you can change the system
> class loader.
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: Li, Jun [mailto:jun.li@...]
> > Sent: Friday, November 06, 2009 5:00 PM
> > To: Jeroen Frijters; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jeroen,
> >
> > I thought that the cause of the problem is that those two jar files
> > (activation.jar and axis.jar) are NOT in the same classloader.
> > Currently, the axis is loaded in system class loader (I guess the
> > AssemblyClassLoader is the default one).
> >
> > Thanks,
> > Jun
> >
> > -----Original Message-----
> > From: Jeroen Frijters [mailto:jeroen@...]
> > Sent: Friday, November 06, 2009 10:53 AM
> > To: Li, Jun; ikvm-developers@...
> > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> >
> > Hi Jun,
> >
> > Why not simply make sure that the axis assembly is reachable via the

> > system class loader?
> >
> > Regards,
> > Jeroen
> >
> > > -----Original Message-----
> > > From: Li, Jun [mailto:jun.li@...]
> > > Sent: Friday, November 06, 2009 4:43 PM
> > > To: Jeroen Frijters; ikvm-developers@...
> > > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> > >
> > > Hi Jeroen,
> > >
> > > Yes, you are right. The class loader of
> javax.activation.DataHandler
>
> > > is null and it is bootstrap class loader.
> > > Just wondering how can I add/recompile the axis.jar in the boot
> > > class library. (I know it is awful).
> > > Otherwise, not sure if anyone else used the axis via IKVM since I
> > > don't really want to rewrite those web service code in c#.
> > >
> > > Thanks,
> > > Jun
> > >
> > > -----Original Message-----
> > > From: Jeroen Frijters [mailto:jeroen@...]
> > > Sent: Friday, November 06, 2009 10:33 AM
> > > To: Li, Jun; ikvm-developers@...
> > > Subject: RE: [Ikvm-developers] calling wbeservice with axis
> > >
> > > Hi,
> > >
> > > The class loader of javax.activation.DataHandler is null (aka the
> > > bootstrap class loader). In IKVM.NET you cannot add stuff to the
> > > boot class path (except by recompiling the boot class library),
> > > but I seriously doubt that's necessary. Most code in the boot
> > > class library uses either the system or the thread context class
loader.

> > >
> > > Regards,
> > > Jeroen
> > >
> > > > -----Original Message-----
> > > > From: jun_li [mailto:jun.li@...]
> > > > Sent: Friday, November 06, 2009 4:15 PM
> > > > To: ikvm-developers@...
> > > > Subject: [Ikvm-developers] calling wbeservice with axis
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I try to invoke the webservice call implemented in java(I
> > > > converted the java code into dll).
> > > > I got the following error:
> > > > javax.activation.UnsupportedDataTypeException: no object DCH for

> > > > MIME type text/plain  at
> > > > javax.activation.DataHandler.getInputStream(DataHandler.java:248
> > > > )
> > > >  at
> > > >
> > >
> >
>
javax.activation.DataHandlerDataSource.getInputStream(DataHandler.java:

> > > > 703)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > > 7
> > > > 3)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:
> > > > 3
> > > > 8)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.attachments.AttachmentsImpl.getContentLength(Attachmen
> > > > t
> > > > sImpl.java:438)
> > > >  at org.apache.axis.Message.getContentLength(Message.java:512)
> > > >  at
> > > >
> > >
> >
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> > > > a
> > > > :371)
> > > >  at
> > > >
> > org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138
> > > > )
> > > >  at
> > > >
> > >
> >
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.

> > > > java:33)
> > > >  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:119)
> > > >  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
> > > >  at
> > > > org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
> > > >  at org.apache.axis.client.Call.invokeEngine(Call.java:2786)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:2767)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:2443)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:2366)
> > > >  at org.apache.axis.client.Call.invoke(Call.java:1812)
> > > >
> > > > I did some research.
> > > > It looks like the axis.jar is loaded via
> > > > ikvm.runtime.AssemblyClassLoader, however, the
> > > > javax.activation.DataHandler( I believe it is implemented in
> > > > IKVM.OpenJDK.Misc) is loaded from java.lang.ClassLoader.
> > > >
> > > > Is it possible to have loaded them in the same classloader?
> > > > Or is there other way to handle this?
> > > >
> > > > Thanks,
> > > > Jun
> > > > --
> > > > View this message in context:
> > > > http://old.nabble.com/calling-wbeservice-
> > > > with-axis-tp26230793p26230793.html
> > > > Sent from the IKVM .NET - Dev mailing list archive at
Nabble.com.

> > > >
> > > >
> > > > ----------------------------------------------------------------
> > > > -
> -
> > > > -
> > -
> > > > -
> > > -
> > > > -
> > > > -------
> > > > Let Crystal Reports handle the reporting - Free Crystal Reports
> > 2008
> >
> > > > 30-Day trial. Simplify your report design, integration and
> > > > deployment
> > > > - and focus on what you do best, core application coding.
> Discover
>
> > > > what's new with Crystal Reports now.
> > > > http://p.sf.net/sfu/bobj-july
> > > > _______________________________________________
> > > > Ikvm-developers mailing list
> > > > Ikvm-developers@...
> > > > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
> > >
> > >
> >
> ======================================================================
> > > =
> > > ========
> > >  Please access the attached hyperlink for an important electronic
> > > communications disclaimer:
> > >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > >
> > >
> >
> ======================================================================
> > > =
> > > ========
> > >
> >
> >
> ======================================================================
> > =
> > ========
> >  Please access the attached hyperlink for an important electronic
> > communications disclaimer:
> >  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >
> >
> ======================================================================
> > =
> > ========
> >
>
> ======================================================================
> =
> ========
>  Please access the attached hyperlink for an important electronic
> communications disclaimer:
>  http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> ======================================================================
> =
> ========
>

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 ===============================================================================
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers