Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: dm-serve 2.0 problem spring security dependancy breaks admin console

  1. #1
    Join Date
    Sep 2009
    Posts
    16

    Default dm-serve 2.0 problem spring security dependancy breaks admin console

    Hi Guys,

    I'm using dm-server-2.0.0.CI-493.

    I have ported the spring security example to a spring web bundle, and set all project dependencies scope to provided.

    However, when I install the com.springsource.org.apache.xalan-2.7.0.jar, this causes an error when trying to open the splash or the admin console, so navigating to "http://localhost:8080/" causes the stack trace shown, below.

    Anyone got any ideas what is the problem here?

    Many thanks,

    Jeremy.


    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet.init() for servlet splash threw exception
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    com.springsource.server.web.tomcat.ApplicationName TrackingValve.invoke(ApplicationNameTrackingValve. java:37)
    org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:567)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
    java.lang.Thread.run(Thread.java:619)

    root cause

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.An notationMethodHandlerAdapter': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter]: Constructor threw exception; nested exception is javax.xml.transform.TransformerFactoryConfiguratio nError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:946)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:890)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:479)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:450)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:286)
    org.springframework.web.servlet.DispatcherServlet. createDefaultStrategy(DispatcherServlet.java:679)
    org.springframework.web.servlet.DispatcherServlet. getDefaultStrategies(DispatcherServlet.java:648)
    org.springframework.web.servlet.DispatcherServlet. initHandlerAdapters(DispatcherServlet.java:479)
    org.springframework.web.servlet.DispatcherServlet. initStrategies(DispatcherServlet.java:337)
    org.springframework.web.servlet.DispatcherServlet. onRefresh(DispatcherServlet.java:325)
    org.springframework.web.servlet.FrameworkServlet.o nApplicationEvent(FrameworkServlet.java:526)
    org.springframework.web.servlet.FrameworkServlet.o nApplicationEvent(FrameworkServlet.java:1)
    org.springframework.context.event.GenericApplicati onListenerAdapter.onApplicationEvent(GenericApplic ationListenerAdapter.java:50)
    org.springframework.context.event.SourceFilteringL istener.onApplicationEventInternal(SourceFiltering Listener.java:97)
    org.springframework.context.event.SourceFilteringL istener.onApplicationEvent(SourceFilteringListener .java:68)
    org.springframework.context.event.SimpleApplicatio nEventMulticaster.multicastEvent(SimpleApplication EventMulticaster.java:97)
    org.springframework.context.support.AbstractApplic ationContext.publishEvent(AbstractApplicationConte xt.java:294)
    org.springframework.context.support.AbstractApplic ationContext.finishRefresh(AbstractApplicationCont ext.java:858)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:419)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 43)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 59)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:340 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:307)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:127)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    com.springsource.server.web.tomcat.ApplicationName TrackingValve.invoke(ApplicationNameTrackingValve. java:37)
    org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:567)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
    java.lang.Thread.run(Thread.java:619)

  2. #2
    Join Date
    Oct 2008
    Posts
    493

    Default

    Hi Jeremy, this sounds a lot like a bug. Thanks for bringing it to our attention.

    To help us dig into it, I have a quick question: when you say that you installed Xalan 2.7.0, what did you do with the bundle? Place it in the pickup directory? Place it in repository/usr or repository/ext?
    Andy Wilkinson
    SpringSource

  3. #3
    Join Date
    Sep 2009
    Posts
    16

    Default

    Hi Andy,

    I placed it in the repository usr.

    I'm doing this always for dependencies collected by maven. Except I always try to check that I do not install jars that are already in ext or elsewhere in the repository.

    Here's the list of jars in my usr:

    com.springsource.org.apache.bcel-5.1.0.jar
    com.springsource.org.apache.commons.logging-1.1.1.jar
    com.springsource.org.apache.log4j-1.2.15.jar
    com.springsource.org.apache.regexp-1.5.0.jar
    com.springsource.org.apache.xalan-2.7.0.jar
    com.springsource.org.apache.xerces-2.8.1.jar
    com.springsource.org.apache.xml.resolver-1.2.0.jar
    com.springsource.org.apache.xml.security-1.0.5.D2.jar
    com.springsource.org.apache.xmlcommons-1.3.3.jar
    com.springsource.org.jasig.cas.client-3.1.8.jar
    com.springsource.org.opensaml-1.1.0.jar
    org.springframework.security.cas-3.0.0.RC1.jar
    org.springframework.security.config-3.0.0.RC1.jar
    org.springframework.security.core-3.0.0.RC1.jar
    org.springframework.security.web-3.0.0.RC1.jar

    Removing the xalan jar and re-starting the dm-server seems to fix the problem, putting it back and re-starting re-introduces it.

    Regards,

    Jeremy.

  4. #4
    Join Date
    Oct 2008
    Posts
    493

    Default

    Thanks, Jeremy. Replacing any part of the JVM's XML parsing-related libraries is unfortunately never a completely straightforward thing to do. We'll spend a bit of time looking into this, if nothing else so that we can document it as a known problem. My gut feel at the moment is that the 'right' thing to do will be to place the Xalan jar in the JVM's lib endorsed directory, rather than trying to utilise it as an OSGi bundle.
    Andy Wilkinson
    SpringSource

  5. #5
    Join Date
    Sep 2009
    Posts
    16

    Default

    Hi Andy,

    I thought the prefix of com.springsource in the jar name meant that it had been osgified for the dm-server: com.springsource.org.apache.xalan-2.7.0.jar

    Just so I'm clear, are you saying that I should put this jar into my %JAVA_HOME%/lib folder?

    Regards,

    Jeremy.

  6. #6
    Join Date
    Oct 2008
    Location
    Southampton, England
    Posts
    61

    Default

    Hi Jeremy,

    I have been looking in to it and have documented the problem under an issue we created in JIRA to track this. https://issuetracker.springsource.com/browse/DMS-2245

    As Andy says, untill we do somehting better you should just put the xalan jar in your %JAVA_HOME%/lib directory. The details of what is going wrong is in the JIRAs child issue https://issuetracker.springsource.com/browse/DMS-2248.

    Chris.

  7. #7
    Join Date
    Oct 2008
    Posts
    493

    Default

    Quote Originally Posted by jeremy View Post
    Hi Andy,

    I thought the prefix of com.springsource in the jar name meant that it had been osgified for the dm-server: com.springsource.org.apache.xalan-2.7.0.jar
    The com.springsource prefix means that we've modified that JAR file, in this case to update its manifest to be a valid OSGi bundle. It, unfortunately, doesn't mean that it's guaranteed to work in an OSGi environment out of the box. There may be problems with the way the library is written, such as the use of META-INF/services as in this case, that mean it doesn't work properly when combined with OSGi.

    Just so I'm clear, are you saying that I should put this jar into my %JAVA_HOME%/lib folder?
    When I originally replied, I had thought that it needed to go in %JAVA_HOME%/lib/endorsed but, having read around a little more, I think I was mistaken. Apologies. I believe you're right, the jar should be placed in %JAVA_HOME%/lib.
    Andy Wilkinson
    SpringSource

  8. #8
    Join Date
    Sep 2009
    Posts
    16

    Default

    Hi Andy,

    With the com.springsource.org.apache.xalan-2.7.0.jar in my %JAVA_HOME%/lib I now get the following:

    Resolver report:
    An Import-Package could not be resolved. Caused by missing constraint in bundle <springsecuritycas_1.0.0>
    constraint: <Import-Package: org.jasig.cas.client.util; version="0.0.0"> constrianed to bundle <com.springsource.org.jasig.cas.client> constrained bundle version range "[3.1.8,3.1.8]"
    An Import-Package could not be resolved. Caused by missing constraint in bundle <com.springsource.org.jasig.cas.client_3.1.8>
    constraint: <Import-Package: org.opensaml; version="[1.1.0,2.0.0)"> constrained bundle version range "0.0.0"
    An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.cas_3.0.0.RC1>
    constraint: <Import-Package: org.jasig.cas.client.authentication; version="[3.1.1,3.2.0)"> constrained bundle version range "0.0.0"
    An Import-Package could not be resolved. Caused by missing constraint in bundle <com.springsource.org.opensaml_1.1.0>
    constraint: <Import-Package: org.apache.xml.security; version="[1.0.5.D2,2.0.0)"> constrained bundle version range "0.0.0"
    An Import-Package could not be resolved. Caused by missing constraint in bundle <com.springsource.org.apache.xml.security_1.0.5.D2 >
    constraint: <Import-Package: org.apache.xml.dtm; version="[2.7.0,3.0.0)"> constrained bundle version range "0.0.0"

    I think the problem is the org.apache.xml.dtm which is in the xalan.jar.

    Any ideas?

    Regards,

    Jeremy.

  9. #9
    Join Date
    Oct 2008
    Posts
    493

    Default

    You can make a package that's on the VM's application classpath available for import by a bundle by listing it as a system package. This is done by adding the package name to the org.osgi.framework.system.packages property in the lib/java6-server.profile file.

    In short, I think you can fix this problem by editing lib/java6-server.profile and adding org.apache.xml.dtm to the org.osgi.framework.system.packages property.
    Andy Wilkinson
    SpringSource

  10. #10
    Join Date
    Sep 2009
    Posts
    16

    Default

    Hi Andy,

    That still doesn't seem to resolve the problem.

    Please don't take this the wrong way, but could I ask a huge favour:

    Is it possible someone could point me at instructions to port the spring security cas sample (client) to run on the dm-server as a web bundle?

    Regards,

    Jeremy.

Tags for this Thread

Posting Permissions

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