You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Sujoy <sb...@eforceglobal.com> on 2009/11/12 14:06:34 UTC

How to Integrate Axis2 with Sling 5

Hi,

I am having one typical requirement where I need to write one Axis2 ADB
client inside sling 5 to consume one Web Service exposed by some other
application. But when I am trying to include Axis2 jar inside sling its
showing some strange behavior. My POM dependencies are as given below.

      <dependency>
    		<groupId>org.apache.ws.commons.axiom</groupId>
    		<artifactId>axiom-api</artifactId>
    		<version>1.2.7</version>
	</dependency>
 
	<dependency>
    		<groupId>org.apache.ws.commons.axiom</groupId>
    		<artifactId>axiom-dom</artifactId>
    		<version>1.2.7</version>
	</dependency>

	<dependency>
    		<groupId>org.apache.ws.commons.axiom</groupId>
    		<artifactId>axiom-impl</artifactId>
    		<version>1.2.7</version>
	</dependency>

	<dependency>
    	     <groupId>org.apache.geronimo.specs</groupId>
    	     <artifactId>geronimo-javamail_1.4_spec</artifactId>
    	     <version>1.3</version>
    	     <scope>provided</scope>
	</dependency> 
	
	<dependency>
            <groupId>org.apache.ws.commons.neethi</groupId>
    	      <artifactId>neethi</artifactId>
    	      <version>2.0</version>
	</dependency>

	<dependency>
    	        <groupId>org.apache.woden</groupId>
    	        <artifactId>woden-api</artifactId>
    	        <version>1.0M8</version>
	</dependency> 
	
      <dependency>
    	         <groupId>org.apache.woden</groupId>
    	         <artifactId>woden-impl-dom</artifactId>
    	         <version>1.0M8</version>
	</dependency>
	
       <dependency>
    	        <groupId>org.apache.ws.commons.schema</groupId>
    	        <artifactId>XmlSchema</artifactId>
    	        <version>1.4.2</version>
	</dependency>
  
	<dependency>
    	        <groupId>org.apache.axis2</groupId>
    	        <artifactId>org.apache.axis2.osgi</artifactId>
    	        <version>1.5</version>
	</dependency> 
	<dependency>
    	         <groupId>xalan</groupId>
    	         <artifactId>xalan</artifactId>
    	         <version>2.7.0</version>
	</dependency>   
	<dependency>
    	        <groupId>stax</groupId>
    	        <artifactId>stax-api</artifactId>
    	        <version>1.0</version>
	</dependency>
	<dependency>
    	       <groupId>annogen</groupId>
    	       <artifactId>annogen</artifactId>
    	       <version>0.1.0</version>
	</dependency>  
	<dependency>
    	        <groupId>org.apache.xmlbeans</groupId>
    	        <artifactId>xmlbeans</artifactId>
    	        <version>2.3.0</version>
	</dependency>

But whenever I am trying to consume the service it's throwing the following
error.

java.lang.NoClassDefFoundError: org/apache/axis2/databinding/ADBBean
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.findCla
ss(ModuleImpl.java:1515)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDele
gation(ModuleImpl.java:508)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.jav
a:58)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadCla
ss(ModuleImpl.java:1405)
	at java.lang.ClassLoader.loadClass(Unknown Source)


If someone can put some light on the resolution of this will be of great
help.

Regards,
Sujoy Bhattacharjee

 
    
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4599 (20091112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Re: How to Integrate Axis2 with Sling 5

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Nov 16, 2009 at 14:18, Sujoy <sb...@eforceglobal.com> wrote:
> Hi Alex,
>
> Thanks for the information but installing " org.apache.axis2.osgi" via Felix
> console didn't not make any difference. There also some internal
> dependencies are there which are hard to resolve.
>
> I was just searching over the net and found one link,
>
> https://svn.apache.org/repos/asf/webservices/axis2/scratch/java/saminda/osgi
> _test
>
> It's a simple example where osgification of AXIS2 has been done
> successfully. There also it's clearly stated there are around twenty two jar
> are there as a part of an external dependencies with axis2 osgi bundle.
>
> I did follow the same steps for sling but failed at the final steps by
> showing the following error message.
>
>  16.11.2009 18:31:46.991 *ERROR* [Configuration Updater]
> org.apache.felix.configadmin Service
> [org.apache.felix.cm.ConfigurationAdmin,17]
> [org.osgi.service.cm.ManagedService]: Unexpected problem updating
> configuration (javax.xml.stream.FactoryConfigurationError: Requested factory
> com.ctc.wstx.stax.WstxInputFactory cannot be located.  Classloader
> =sun.misc.Launcher$AppClassLoader@e39a3e)
> javax.xml.stream.FactoryConfigurationError: Requested factory
> com.ctc.wstx.stax.WstxInputFactory cannot be located.  Classloader
> =sun.misc.Launcher$AppClassLoader@e39a3e
>        at
> javax.xml.stream.FactoryLocator.loadFactory(FactoryLocator.java:120)
>        at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:109)
>        at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:54)
>
> If I am not wrong then this error is coming due to OSGI class loading
> mechanism. If you can put some light on this will be helpful :-)

I think you should try and include all the bundles necessary, as the
project you mention has done already. For OSGi, bundles are required,
which are normal jar files with additional information about what
packages to import and export. Apart from dynamic resolution of
packages at runtime (finding which bundle currently provides a
package), OSGi allows bundles to have private packages that are
invisible to other bundles. For non-bundleized jars this means some
up-front manual work.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

RE: How to Integrate Axis2 with Sling 5

Posted by Sujoy <sb...@eforceglobal.com>.
Hi Alex,

Thanks for the information but installing " org.apache.axis2.osgi" via Felix
console didn't not make any difference. There also some internal
dependencies are there which are hard to resolve.

I was just searching over the net and found one link,

https://svn.apache.org/repos/asf/webservices/axis2/scratch/java/saminda/osgi
_test

It's a simple example where osgification of AXIS2 has been done
successfully. There also it's clearly stated there are around twenty two jar
are there as a part of an external dependencies with axis2 osgi bundle. 

I did follow the same steps for sling but failed at the final steps by
showing the following error message.

  16.11.2009 18:31:46.991 *ERROR* [Configuration Updater]
org.apache.felix.configadmin Service
[org.apache.felix.cm.ConfigurationAdmin,17]
[org.osgi.service.cm.ManagedService]: Unexpected problem updating
configuration (javax.xml.stream.FactoryConfigurationError: Requested factory
com.ctc.wstx.stax.WstxInputFactory cannot be located.  Classloader
=sun.misc.Launcher$AppClassLoader@e39a3e)
javax.xml.stream.FactoryConfigurationError: Requested factory
com.ctc.wstx.stax.WstxInputFactory cannot be located.  Classloader
=sun.misc.Launcher$AppClassLoader@e39a3e
	at
javax.xml.stream.FactoryLocator.loadFactory(FactoryLocator.java:120)
	at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:109)
	at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:54)

If I am not wrong then this error is coming due to OSGI class loading
mechanism. If you can put some light on this will be helpful :-)

Regards,
Sujoy


-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Friday, November 13, 2009 8:51 PM
To: dev@sling.apache.org
Cc: Sujoy
Subject: Re: How to Integrate Axis2 with Sling 5

On Fri, Nov 13, 2009 at 15:38, Sujoy <sb...@eforceglobal.com>
wrote:
> Hi Alex,
>
> Thanks for the information. Using <Embed-Dependency> I have overcome the
> AXIS2-ADB ClassNotFound Exception. But really couldn't able to integrate
> AXIS2 with sling5.After putting this tag lots of other dependencies has
> come-up which is actually preventing me to activate my bundle. Some of
this
> are as follows.
>
> !! com.sun.javadoc,version=0.0.0 from -- Cannot be resolved
> !! com.sun.mirror.declaration,version=0.0.0 from -- Cannot be resolved
> !! com.sun.org.apache.xerces.internal.parsers,version=0.0.0 from -- Cannot
> be resolved
> !! com.sun.org.apache.xerces.internal.util,version=0.0.0 from -- Cannot be
> resolved
> !! com.sun.org.apache.xerces.internal.xni.parser,version=0.0.0 from --
> Cannot be resolved
> !! com.sun.tools.javac,version=0.0.0 from -- Cannot be resolved
> !! com.sun.tools.javadoc,version=0.0.0 from -- Cannot be resolved

Configuring EmbedDependency can be quite tricky, as you need to
explicitly ignore/export packages and take the dependencies into
account.

Since org.apache.axis2.osgi seems to be an OSGI bundle with everything
in it (IIUC), I suggest you first try to install that as a bundle. You
can use the Felix web management console (/system/console/bundles).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4610 (20091115) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4611 (20091116) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Re: How to Integrate Axis2 with Sling 5

Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, Nov 13, 2009 at 15:38, Sujoy <sb...@eforceglobal.com> wrote:
> Hi Alex,
>
> Thanks for the information. Using <Embed-Dependency> I have overcome the
> AXIS2-ADB ClassNotFound Exception. But really couldn't able to integrate
> AXIS2 with sling5.After putting this tag lots of other dependencies has
> come-up which is actually preventing me to activate my bundle. Some of this
> are as follows.
>
> !! com.sun.javadoc,version=0.0.0 from -- Cannot be resolved
> !! com.sun.mirror.declaration,version=0.0.0 from -- Cannot be resolved
> !! com.sun.org.apache.xerces.internal.parsers,version=0.0.0 from -- Cannot
> be resolved
> !! com.sun.org.apache.xerces.internal.util,version=0.0.0 from -- Cannot be
> resolved
> !! com.sun.org.apache.xerces.internal.xni.parser,version=0.0.0 from --
> Cannot be resolved
> !! com.sun.tools.javac,version=0.0.0 from -- Cannot be resolved
> !! com.sun.tools.javadoc,version=0.0.0 from -- Cannot be resolved

Configuring EmbedDependency can be quite tricky, as you need to
explicitly ignore/export packages and take the dependencies into
account.

Since org.apache.axis2.osgi seems to be an OSGI bundle with everything
in it (IIUC), I suggest you first try to install that as a bundle. You
can use the Felix web management console (/system/console/bundles).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

RE: How to Integrate Axis2 with Sling 5

Posted by Sujoy <sb...@eforceglobal.com>.
Hi Alex,

Thanks for the information. Using <Embed-Dependency> I have overcome the
AXIS2-ADB ClassNotFound Exception. But really couldn't able to integrate
AXIS2 with sling5.After putting this tag lots of other dependencies has  
come-up which is actually preventing me to activate my bundle. Some of this
are as follows.

!! com.sun.javadoc,version=0.0.0 from -- Cannot be resolved
!! com.sun.mirror.declaration,version=0.0.0 from -- Cannot be resolved
!! com.sun.org.apache.xerces.internal.parsers,version=0.0.0 from -- Cannot
be resolved
!! com.sun.org.apache.xerces.internal.util,version=0.0.0 from -- Cannot be
resolved
!! com.sun.org.apache.xerces.internal.xni.parser,version=0.0.0 from --
Cannot be resolved
!! com.sun.tools.javac,version=0.0.0 from -- Cannot be resolved
!! com.sun.tools.javadoc,version=0.0.0 from -- Cannot be resolved



If you have done this before then can you please put some light on this. If
this is a limitation Felix having then we need to start thinking seriously
on this.

Regards,
Sujoy 
 

-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Thursday, November 12, 2009 8:02 PM
To: dev@sling.apache.org
Subject: Re: How to Integrate Axis2 with Sling 5

On Thu, Nov 12, 2009 at 15:09, Sujoy <sb...@eforceglobal.com>
wrote:
> Actually I am having the flowing as a part of dependency which should
> download and install axis2-adb automatically.
>
> <dependency>
>                <groupId>org.apache.axis2</groupId>
>                <artifactId>org.apache.axis2.osgi</artifactId>
>                <version>1.5</version>
> </dependency>

Did you deploy that bundle into Sling? The exception happens at
runtime. Having it just as a dependency in your project's pom and then
deploying that project's bundle onto sling won't automatically deploy
dependencies.

For bundles that are common and might be used by other bundles as
well, it makes sense to deploy them separately. Otherwise, if it's
only an implementation-specific helper library for your project
bundle, you can use the maven-bundle-plugin [1] and the
<EmbedDependency> configuration.

[1] http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4599 (20091112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4603 (20091113) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Re: How to Integrate Axis2 with Sling 5

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Nov 12, 2009 at 15:09, Sujoy <sb...@eforceglobal.com> wrote:
> Actually I am having the flowing as a part of dependency which should
> download and install axis2-adb automatically.
>
> <dependency>
>                <groupId>org.apache.axis2</groupId>
>                <artifactId>org.apache.axis2.osgi</artifactId>
>                <version>1.5</version>
> </dependency>

Did you deploy that bundle into Sling? The exception happens at
runtime. Having it just as a dependency in your project's pom and then
deploying that project's bundle onto sling won't automatically deploy
dependencies.

For bundles that are common and might be used by other bundles as
well, it makes sense to deploy them separately. Otherwise, if it's
only an implementation-specific helper library for your project
bundle, you can use the maven-bundle-plugin [1] and the
<EmbedDependency> configuration.

[1] http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: How to Integrate Axis2 with Sling 5

Posted by Michael Dürig <mi...@day.com>.
> Actually I am having the flowing as a part of dependency which should
> download and install axis2-adb automatically.

Ah I see. In my case I didn't use org.apache.axis2.osgi since I'm stuck 
with an older version of Axis2. I included all Axis2 dependencies into 
my bundle.

Did you install org.apache.axis2.osgi as OSGi bundle with Sling? You 
should then see the packages from axis2-adb exported in the management 
console. If this is the case loading classes from axis2-adb should 
actually succeed.

Michael


> 
> <dependency>
>     	        <groupId>org.apache.axis2</groupId>
>     	        <artifactId>org.apache.axis2.osgi</artifactId>
>     	        <version>1.5</version>
> </dependency>
> 
> You can check the following link. 
> 
> http://mvnrepository.com/artifact/org.apache.axis2/org.apache.axis2.osgi/1.5
> 
> Thanks,
> sujoy
> 
> -----Original Message-----
> From: Michael Dürig [mailto:michael.duerig@day.com] 
> Sent: Thursday, November 12, 2009 6:44 PM
> To: dev@sling.apache.org
> Subject: Re: How to Integrate Axis2 with Sling 5
> 
>> I am having one typical requirement where I need to write one Axis2 ADB
>> client inside sling 5 to consume one Web Service exposed by some other
>> application. But when I am trying to include Axis2 jar inside sling its
>> showing some strange behavior. My POM dependencies are as given below.
> 
> Not sure, but it seems to me axis2-adb is in missing from your dependencies.
> 
> Michael
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 4599 (20091112) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
>  
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 4599 (20091112) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
>  
> 


RE: How to Integrate Axis2 with Sling 5

Posted by Sujoy <sb...@eforceglobal.com>.
Hi Michael,

Actually I am having the flowing as a part of dependency which should
download and install axis2-adb automatically.

<dependency>
    	        <groupId>org.apache.axis2</groupId>
    	        <artifactId>org.apache.axis2.osgi</artifactId>
    	        <version>1.5</version>
</dependency>

You can check the following link. 

http://mvnrepository.com/artifact/org.apache.axis2/org.apache.axis2.osgi/1.5

Thanks,
sujoy

-----Original Message-----
From: Michael Dürig [mailto:michael.duerig@day.com] 
Sent: Thursday, November 12, 2009 6:44 PM
To: dev@sling.apache.org
Subject: Re: How to Integrate Axis2 with Sling 5

> I am having one typical requirement where I need to write one Axis2 ADB
> client inside sling 5 to consume one Web Service exposed by some other
> application. But when I am trying to include Axis2 jar inside sling its
> showing some strange behavior. My POM dependencies are as given below.

Not sure, but it seems to me axis2-adb is in missing from your dependencies.

Michael

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4599 (20091112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4599 (20091112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Re: How to Integrate Axis2 with Sling 5

Posted by Michael Dürig <mi...@day.com>.
> I am having one typical requirement where I need to write one Axis2 ADB
> client inside sling 5 to consume one Web Service exposed by some other
> application. But when I am trying to include Axis2 jar inside sling its
> showing some strange behavior. My POM dependencies are as given below.

Not sure, but it seems to me axis2-adb is in missing from your dependencies.

Michael