Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Struts 2 Integration with Spring DM

  1. #11
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    As I replied in the other thread, loading resources from the stream is different then resolving them. The OSGi platform is always going to use its own URL schema no matter how you try to pack things up - if the library expects just file:// or jar:// then this is not going to work.
    Regarding the bootpath delegation, I'm sure there are other examples on the internet as well. Try to use various startup combinations and as a simple test, double check what packages are exported by the system bundle.
    Also, make sure the packages that you export are available on the startup classpath since otherwise the platform does delegate but it cannot find the classes requested.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  2. #12
    Join Date
    Jul 2006
    Posts
    126

    Default

    Hi Costin,

    I am trying to make struts and xwork bundles as boot classpath bundles. I am trying to use the fragment bundle approach for this since the bootclasspath approach didn't work for me. I think this was also discussed in another post at http://forum.springsource.org/showthread.php?t=68479.

    I have converted the struts and xwork bundle as fragments by adding the header

    Code:
    Fragment-Host: system.bundle; extension: framework
    to the manifests of these bundles. However when I start the OSGi framework within eclipse I see the bundles get into the 'Installed' state and not 'Resolved' state.

    Also they showed no host bundles when I ran the bundle command.

    HTML Code:
    osgi> bundle 83
    getService[System Bundle [0]]({org.eclipse.osgi.framework.console.CommandProvider}={service.ranking=2147483647, service.id=21})
    getService[System Bundle [0]]({org.eclipse.osgi.framework.console.CommandProvider}={service.ranking=2147483647, service.pid=0.org.eclipse.core.runtime.internal.adaptor.EclipseCommandProvider, service.vendor=Eclipse.org, service.id=17})
    initial@reference:file:xwork-core-2.1.4.jar/ [83]
      Id=83, Status=INSTALLED   Data Root=C:\osgi\.metadata\.plugins\org.eclipse.pde.core\Spring-DM-TP\org.eclipse.osgi\bundles\83\data
      No registered services.
      No services in use.
    getServiceReference(org.osgi.service.packageadmin.PackageAdmin)
      Exported packages
        com.opensymphony.xwork2.spring; version="2.1.4"[exported]
        com.opensymphony.xwork2.conversion.metadata; version="2.1.4"[exported]
      ....
      ....
      ....
      No imported packages
    getService[System Bundle [0]]({org.osgi.service.packageadmin.PackageAdmin}={service.ranking=2147483647, service.pid=0.org.eclipse.osgi.framework.internal.core.PackageAdminImpl, service.vendor=Eclipse.org, service.id=2})
      No host bundles
      No named class spaces
      No required bundles
    ungetService[System Bundle [0]]({org.osgi.service.packageadmin.PackageAdmin}={service.ranking=2147483647, service.pid=0.org.eclipse.osgi.framework.internal.core.PackageAdminImpl, service.vendor=Eclipse.org, service.id=2})
    Could you see any problem here?

    Please let me know your comments.

    Thanks,
    Shashi

  3. #13
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    First your fragment declaration is wrong - it should be :
    Code:
    Fragment-Host = system.bundle; extension:=framework
    
    Second, make sure your fragment bundles do not have imports - as they are installed with the framework, they ideally should work standalone and not depend on any other bundles.
    I see you're using Equinox - search their documentation on how to enable logging which will indicate why your bundles are not resolved if the above fails.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  4. #14
    Join Date
    Jul 2006
    Posts
    126

    Default

    Thanks for correcting the headers Costin,

    The xwork and struts bundles depend on various other bundles. Does that mean that I cannot deploy these bundles as fragment?

    Or alternatively can I make the bundles on which these bundles depend on also as fragment bundles?

    Thanks for your help,
    Shashi

  5. #15
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    You can try it out and see what you achieve but since fragments are attached to the host bundle, I think it's best to have them be self sufficient - that is, the fragments should not depend on other bundles.
    Consider the case where the depending bundles get unresolved - in that case the attached fragments get unresolved as well which means the packages exported by the framework cannot be used any more.
    The less dependencies and the cleaner your setup is, the less side effects you'll have down the road.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  6. #16
    Join Date
    Jan 2010
    Location
    pune
    Posts
    1

    Default I am stuck off with above problem .....

    an 19, 2010 6:20:00 PM org.apache.catalina.core.StandardContext filterStart
    SEVERE: Exception starting filter struts2
    Class: org.apache.struts2.osgi.OsgiConfigurationProvider
    File: OsgiConfigurationProvider.java
    Method: init
    Line: 70 - org/apache/struts2/osgi/OsgiConfigurationProvider.java:70:-1
    at org.apache.struts2.dispatcher.Dispatcher.init(Disp atcher.java:431)
    at org.apache.struts2.dispatcher.FilterDispatcher.ini t(FilterDispatcher.java:190)
    at org.apache.catalina.core.ApplicationFilterConfig.g etFilter(ApplicationFilterConfig.java:275)
    at org.apache.catalina.core.ApplicationFilterConfig.s etFilterDef(ApplicationFilterConfig.java:397)
    at org.apache.catalina.core.ApplicationFilterConfig.< init>(ApplicationFilterConfig.java:108)
    at org.apache.catalina.core.StandardContext.filterSta rt(StandardContext.java:3696)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4343)
    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:525)
    at org.apache.catalina.startup.HostConfig.deployDirec tory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirec tories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:413)
    Caused by: java.lang.NullPointerException
    at org.apache.struts2.osgi.OsgiConfigurationProvider. init(OsgiConfigurationProvider.java:70)
    at com.opensymphony.xwork2.config.impl.DefaultConfigu ration.reloadContainer(DefaultConfiguration.java:2 03)
    at com.opensymphony.xwork2.config.ConfigurationManage r.getConfiguration(ConfigurationManager.java:55)
    at org.apache.struts2.dispatcher.Dispatcher.init_Prel oadConfiguration(Dispatcher.java:374)
    at org.apache.struts2.dispatcher.Dispatcher.init(Disp atcher.java:418)
    ... 28 more

  7. #17
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    The stacktrace doesn't how any Spring DM package so the problem seems to lay outside of it.
    Please start your own thread and add some context about what are you trying to solve - just posting a stracktrace out of the blue is not very helpful (and so will be the answers).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  8. #18
    Join Date
    Mar 2010
    Posts
    12

    Default

    Hi Shashi,

    I am also facing the problem to integrate struts with spring dm/springsource dm server.

    Does your issue solved?

    Could you pass any help you may have?

    I had posted problem and the link is:
    http://stackoverflow.com/questions/2...atus-503-error

    Thanks in advance.
    Gohil

  9. #19
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    For dmServer related questions, it's best to use the dmServer forum: http://forum.springsource.org/forumdisplay.php?f=53
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

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