Results 1 to 9 of 9

Thread: Axis2 Integration with the Spring OSGI

  1. #1
    Join Date
    Mar 2009
    Location
    Quezon City, Philippines
    Posts
    10

    Default How to migrate from Standard War File with Axis2 framework to Shared-libraries WAR.

    Hi, is it possible to integrate axis2 and spring dm? I want to migrate my project using axis 2 webservice integrated with spring framework to spring osgi and deploy in spring dm. Thank you very much.
    Last edited by rgam; Mar 26th, 2009 at 05:44 AM.

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Why not.
    OSGified versions of Axis JARs are already available from S2 Repo http://www.springsource.com/reposito...rch?query=axis
    But even if they weren't there is a lot of things that could be done.
    You might want to elaborate on your question a bit

  3. #3
    Join Date
    Mar 2009
    Location
    Quezon City, Philippines
    Posts
    10

    Default

    Thanks for replying. What I want to do is to migrate my application to "shared-lib war" then deploy it on spring dm. My problem is the directory structure of my webapps when I migrate it to "shared-lib war".

    Below is my application directory structure. What is the directory structure if I migrate it to "shared-lib war". Thank you very much.

    webapps
    |_ sample
    |_ axis2-web
    |_ css
    |_ images
    |_ js
    |_ lib
    |_ META-INF
    |_ WEB -INF
    |_ conf
    |_ lib
    |_ modules
    |_ sevices
    |_ sample
    | |_ META-INF
    | |_ services.xml
    |_ web.xml
    |_ <some html files>

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Well, normally I would say remove all the dependencies from the WEB-INF/lib and substitute them with Import-Bundle/Import-Package statements in your MEAT-INF/MANIFEST.MF which should be a quick and easy process. . . so I tried to do it but there seem to be a bug which I am still investigating:

    Code:
    Caused by: java.lang.IllegalArgumentException
    	at org.eclipse.osgi.service.resolver.VersionRange.<init>(VersionRange.java:64)
    	at org.eclipse.osgi.internal.resolver.StateBuilder.getVersionRange(StateBuilder.java:520)
    	at org.eclipse.osgi.internal.resolver.StateBuilder.addImportPackages(StateBuilder.java:264)
    	at org.eclipse.osgi.internal.resolver.StateBuilder.createImportPackages(StateBuilder.java:243)
    I have to see what bundle is causing it. I'll let you know and open JIRA issues once I get more info.

  5. #5
    Join Date
    Mar 2009
    Location
    Quezon City, Philippines
    Posts
    10

    Default

    Thank you for the effort in helping me out.

    I have another question regarding the thread. What if I create 2 bundle projects. Bundle A holds all of my applications (src, webapps etc), while bundle B holds all my jar files (lets assume we will not use the spring dm's bundles, lib, packages.). Inside my bundle B has a lib folder, I copied all my jar files there then I add to build path all the jar files. All my jar files are now referenced libraries.

    How can bundle A see the jars in bundle B?

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Well. . . everything is possible. . . it is Java code after all , but here i the thought
    You can swim against the current, you can swim with no current or you can swim with the current.
    Of the top of my head you could implement some plumbing code to make class loader of bundle A available to bundle B
    Code:
    BundleContext.getBundle(..).getClass().getClassLoader()
    You could probably do it simpler by throwing all your JARs in the ext or lib directory of your JVM and modify the bootdelegation option to make them visible to the bootstrap loader

    In any event IMHO this will be an example of swimming against the current.
    This architecture would go against the main principles of OSGi. . . modularity, isolation, versioning etc. . . . which would raise another question, why bother with OSGi in the first place.
    I am a bit closer in figuring out this issue. I already know there is a problem with one of the dependent bundles which I am trying to track down. I'll keep you posted.

  7. #7
    Join Date
    Mar 2009
    Location
    Quezon City, Philippines
    Posts
    10

    Default

    Hi Oleg, you are right, it will go against the main principles of OSGI. I'll rephrase my question again for more clarification. I want to migrate my Standard WAR file that is using Axis2 framework to Shared-libraries WAR file.

  8. #8
    Join Date
    Apr 2010
    Posts
    2

    Default axis2,osgi and xmlbeans

    Hi everyone

    i´m quite new at osgi. I´m trying to develop and web service using axis2 and osgi. I found the way to do in some post. At the begining i was able to develop different examples.
    The problem appeared when I tried to return datatypes from a lib that is made using xmlbeans datatype.
    I obtain the following error:

    !ENTRY org.eclipse.osgi 4 0 2010-04-21 17:25:15.062

    !MESSAGE An unexpected runtime error has occurred.

    !STACK 0

    java.lang.NoClassDefFoundError: javax/xml/namespace/QName

    at java.lang.Class.getDeclaredMethods0(Native Method)

    at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2395)

    at java.lang.Class.getDeclaredMethods(Class.java:1763 )

    at java.beans.Introspector$1.run(Introspector.java:12 80)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.beans.Introspector.getPublicDeclaredMethods(I ntrospector.java:1278)

    at java.beans.Introspector.getTargetMethodInfo(Intros pector.java:1144)

    at java.beans.Introspector.getBeanInfo(Introspector.j ava:402)

    at java.beans.Introspector.getBeanInfo(Introspector.j ava:166)

    at java.beans.Introspector.getBeanInfo(Introspector.j ava:227)

    at java.beans.Introspector.getBeanInfo(Introspector.j ava:215)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchema(DefaultSchemaGenerator. java:545)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchemaforFieldsandProperties(D efaultSchemaGenerator.java:691)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchema(DefaultSchemaGenerator. java:555)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchemaforFieldsandProperties(D efaultSchemaGenerator.java:693)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchema(DefaultSchemaGenerator. java:555)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchemaforFieldsandProperties(D efaultSchemaGenerator.java:691)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchema(DefaultSchemaGenerator. java:555)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchemaforFieldsandProperties(D efaultSchemaGenerator.java:693)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchema(DefaultSchemaGenerator. java:555)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchemaForType(DefaultSchemaGen erator.java:862)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.processMethods(DefaultSchemaGenerator. java:356)

    at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.generateSchema(DefaultSchemaGenerator. java:252)

    at org.apache.axis2.description.AxisService.createSer vice(AxisService.java:2347)

    at org.apache.axis2.description.AxisService.createSer vice(AxisService.java:2304)

    at org.apache.axis2.osgi.deployment.tracker.WSTracker .createWS(WSTracker.java:139)

    at org.apache.axis2.osgi.deployment.tracker.WSTracker .access$000(WSTracker.java:42)

    at org.apache.axis2.osgi.deployment.tracker.WSTracker $1.serviceChanged(WSTracker.java:71)

    at org.eclipse.osgi.internal.serviceregistry.Filtered ServiceListener.serviceChanged(FilteredServiceList ener.java:104)

    at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.dispatchEvent(BundleContextImpl.java:933)

    at org.eclipse.osgi.framework.eventmgr.EventManager.d ispatchEvent(EventManager.java:227)

    at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:149)

    at org.eclipse.osgi.internal.serviceregistry.ServiceR egistry.publishServiceEventPrivileged(ServiceRegis try.java:755)

    at org.eclipse.osgi.internal.serviceregistry.ServiceR egistry.publishServiceEvent(ServiceRegistry.java:7 10)

    at org.eclipse.osgi.internal.serviceregistry.ServiceR egistrationImpl.register(ServiceRegistrationImpl.j ava:129)

    at org.eclipse.osgi.internal.serviceregistry.ServiceR egistry.registerService(ServiceRegistry.java:206)

    at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.registerService(BundleContextImpl.java:50 7)

    at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.registerService(BundleContextImpl.java:52 5)

    at org.slasoi.businessManager.WS.internal.Activator.s tart(Activator.java:22)

    at org.eclipse.osgi.framework.internal.core.BundleCon textImpl$1.run(BundleContextImpl.java:783)

    at java.security.AccessController.doPrivileged(Native Method)

    at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActivator(BundleContextImpl.java:774 )

    at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(BundleContextImpl.java:755)

    at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:352)

    at org.eclipse.osgi.framework.internal.core.AbstractB undle.resume(AbstractBundle.java:370)

    at org.eclipse.osgi.framework.internal.core.Framework .resumeBundle(Framework.java:1068)

    at org.eclipse.osgi.framework.internal.core.StartLeve lManager.resumeBundles(StartLevelManager.java:557)

    at org.eclipse.osgi.framework.internal.core.StartLeve lManager.incFWSL(StartLevelManager.java:464)

    at org.eclipse.osgi.framework.internal.core.StartLeve lManager.doSetStartLevel(StartLevelManager.java:24 8)

    at org.eclipse.osgi.framework.internal.core.StartLeve lManager.dispatchEvent(StartLevelManager.java:445)

    at org.eclipse.osgi.framework.eventmgr.EventManager.d ispatchEvent(EventManager.java:227)

    at org.eclipse.osgi.framework.eventmgr.EventManager$E ventThread.run(EventManager.java:337)

    I tried to add the dependency to the Meta-inf archive and as the dependency:
    <dependency>

    <groupId>org.apache.xmlbeans</groupId>

    <artifactId>xmlbeans-qname</artifactId>

    <version>2.4.0</version>

    </dependency>

    but it didn't work.

    Have anyone got any idea about the mistake, or i don´t know if it is possible to do it?

    thanks in advance.

    Ablerto.

  9. #9

    Default configuring services.xml to access services registered by other bundles

    Hi All,

    I am trying to migrate an application using Axis2 services to Spring DM based OSGi application.

    I have created separate bundles for the services and for the web i have the war file which is marked with bundle nature.

    All the bundles and war file are packaged in PAR. The server is able start all the bundles.

    I have created the applicationContext.xml file to refer to service exposed in the bundles. I have kept all axis libraries as is in the lib folder to start with .
    I also have the services and modules folder in the WEB-INF folder and I am deploying the aar files to the services folder

    I am now finding problem to access my exisiting service defined in a aar file
    The had integrated Spring and Axis2 for writing this service

    Following are the details of applicationContext.xml and services.xml

    applicationContext.xml ->

    <beans:beans xmlns="http://www.springframework.org/schema/osgi"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/osgi
    http://www.springframework.org/schema/osgi/spring-osgi.xsd">

    <reference id="journalEntryService"
    interface="be.healthconnect.timestamping.service.j ournalentry.JournalEntryManager" />

    </beans:beans>


    services.xml->

    <?xml version="1.0" encoding="UTF-8"?>

    <service name="JournalEntryService" provider="java:RPC">
    <description>
    This is a Journal Entry service. Its allows to manage Journal Entries in Buffer Database
    </description>
    <parameter name="ServiceObjectSupplier" locked="false">org.apache.axis2.extensions.spring. receivers.SpringServletContextObjectSupplier</parameter>
    <parameter name="SpringBeanName" locked="false">journalEntryService</parameter>
    <!-- parameter name="ServiceClass">com.healthconnect.service.jour nalentry.impl.JournalEntryManagerImpl</parameter> -->
    <operation name="addJournalEntry">
    <actionMapping>urn:addJournalEntry</actionMapping>
    <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageRe ceiver" />
    </operation>
    <excludeOperations>
    <operation>setJournalDAO</operation>
    </excludeOperations>
    </service>


    When I try to list service details I find the service as faulty and Axis gives the following error

    Error: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Class Not found : $Proxy161 at org.apache.axis2.deployment.repository.util.Archiv eReader.processServiceGroup(ArchiveReader.java:150 ) at org.apache.axis2.deployment.ServiceDeployer.deploy (ServiceDeployer.java:81) at org.apache.axis2.deployment.repository.util.Deploy mentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDep loy(DeploymentEngine.java:659) at org.apache.axis2.deployment.repository.util.WSInfo List.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.upd ate(RepositoryListener.java:337) at org.apache.axis2.deployment.RepositoryListener.che ckServices(RepositoryListener.java:241) at org.apache.axis2.deployment.DeploymentEngine.loadS ervices(DeploymentEngine.java:131) at org.apache.axis2.deployment.WarBasedAxisConfigurat or.loadServices(WarBasedAxisConfigurator.java:284) at org.apache.axis2.context.ConfigurationContextFacto ry.createConfigurationContext(ConfigurationContext Factory.java:95) at org.apache.axis2.transport.http.AxisServlet.initCo nfigContext(AxisServlet.java:525) at org.apache.axis2.transport.http.AxisServlet.init(A xisServlet.java:443) at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4198) at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4512) at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:526) at com.springsource.osgi.webcontainer.tomcat.internal .TomcatServletContainer.startWebApplication(Tomcat ServletContainer.java:119) at com.springsource.osgi.webcontainer.internal.Standa rdWebApplication.start(StandardWebApplication.java :89) at com.springsource.server.web.core.internal.WebBundl eLifecycleListener.onStarted(WebBundleLifecycleLis tener.java:130) at com.springsource.kernel.install.artifact.internal. ArtifactStateMonitor.onStarted(ArtifactStateMonito r.java:215) at com.springsource.kernel.install.artifact.internal. AbstractInstallArtifact.asyncStartSucceeded(Abstra ctInstallArtifact.java:281) at com.springsource.kernel.install.artifact.internal. AbstractInstallArtifact.access$0(AbstractInstallAr tifact.java:278) at com.springsource.kernel.install.artifact.internal. AbstractInstallArtifact$StateMonitorSignal.signalS uccessfulCompletion(AbstractInstallArtifact.java:2 31) at com.springsource.kernel.core.internal.BundleStartT racker$1.run(BundleStartTracker.java:150) at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Class Not found : $Proxy161 at org.apache.axis2.deployment.ServiceBuilder.populat eService(ServiceBuilder.java:431) at org.apache.axis2.deployment.repository.util.Archiv eReader.buildServiceGroup(ArchiveReader.java:101) at org.apache.axis2.deployment.repository.util.Archiv eReader.processServiceGroup(ArchiveReader.java:143 ) ... 29 more Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Class Not found : $Proxy161 at org.apache.axis2.deployment.ServiceBuilder.populat eService(ServiceBuilder.java:394) ... 31 more Caused by: java.lang.ClassNotFoundException: Class Not found : $Proxy161 at org.apache.axis2.deployment.DeploymentClassLoader. findClass(DeploymentClassLoader.java:86) at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07) at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52) at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.axis2.description.java2wsdl.DefaultSche maGenerator.(DefaultSchemaGenerator.java:136) at org.apache.axis2.deployment.util.Utils.fillAxisSer vice(Utils.java:499) at org.apache.axis2.deployment.ServiceBuilder.populat eService(ServiceBuilder.java:386) ... 31 more


    I think I need to make some changes in services.xml file but I am not getting any information on this anywhere. Can someone please guide me?

    Thanks & Regards
    Nitin Gupta

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •