Announcement Announcement Module
Collapse
No announcement yet.
Spring security bundle does not show in console Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security bundle does not show in console

    Hi all,

    sorry to send this again but I could not find my previous post (a similar question during dm beta testing). The question is, if I can see the org.springframework.security bundle in the repository:

    Code:
    mauricio@mobile:~$ ls -1 /home/mauricio/dm-server-1.0.2.RELEASE/repository/bundles/usr/
    com.springsource.antlr-2.7.7.jar
    com.springsource.antlr-sources-2.7.7.jar
    com.springsource.edu.oswego.cs.dl.util.concurrent-1.3.4.jar
    com.springsource.edu.oswego.cs.dl.util.concurrent-sources-1.3.4.jar
    com.springsource.javassist-3.3.0.ga.jar
    com.springsource.javassist-sources-3.3.0.ga.jar
    com.springsource.javax.persistence-1.0.0.jar
    com.springsource.javax.persistence-sources-1.0.0.jar
    com.springsource.javax.xml.stream-1.0.1.jar
    com.springsource.javax.xml.stream-sources-1.0.1.jar
    com.springsource.net.sf.cglib-2.1.3.jar
    com.springsource.net.sf.cglib-sources-2.1.3.jar
    com.springsource.org.apache.commons.codec-1.3.0.jar
    com.springsource.org.apache.commons.codec-sources-1.3.0.jar
    com.springsource.org.apache.commons.collections-3.2.0.jar
    com.springsource.org.apache.commons.collections-sources-3.2.0.jar
    com.springsource.org.apache.commons.dbcp-1.2.2.osgi.jar
    com.springsource.org.apache.commons.dbcp-sources-1.2.2.osgi.jar
    com.springsource.org.apache.commons.logging-1.1.1.jar
    com.springsource.org.apache.commons.logging-sources-1.1.1.jar
    com.springsource.org.apache.commons.pool-1.4.0.jar
    com.springsource.org.apache.commons.pool-sources-1.4.0.jar
    com.springsource.org.dom4j-1.6.1.jar
    com.springsource.org.dom4j-sources-1.6.1.jar
    com.springsource.org.easymock-2.3.0.jar
    com.springsource.org.easymock.classextension-2.3.0.jar
    com.springsource.org.easymock.classextension-sources-2.3.0.jar
    com.springsource.org.easymock-sources-2.3.0.jar
    com.springsource.org.hibernate-3.2.6.ga.jar
    com.springsource.org.hibernate.annotations-3.3.0.ga.jar
    com.springsource.org.hibernate.annotations.common-3.3.0.ga.jar
    com.springsource.org.hibernate.annotations.common-sources-3.3.0.ga.jar
    com.springsource.org.hibernate.annotations-sources-3.3.0.ga.jar
    com.springsource.org.hibernate.ejb-3.3.1.ga.jar
    com.springsource.org.hibernate.ejb-sources-3.3.1.ga.jar
    com.springsource.org.hibernate-sources-3.2.6.ga.jar
    com.springsource.org.hsqldb-1.8.0.9.jar
    com.springsource.org.hsqldb-sources-1.8.0.9.jar
    com.springsource.org.jboss.util-2.0.4.GA.jar
    com.springsource.org.jboss.util-sources-2.0.4.GA.jar
    com.springsource.org.junit-4.5.0.jar
    com.springsource.org.junit-sources-4.5.0.jar
    com.springsource.org.objectweb.asm-1.5.3.jar
    com.springsource.org.objectweb.asm.attrs-1.5.3.jar
    com.springsource.org.objectweb.asm.attrs-sources-1.5.3.jar
    com.springsource.org.objectweb.asm-sources-1.5.3.jar
    com.springsource.slf4j.api-1.5.0.jar
    com.springsource.slf4j.api-sources-1.5.0.jar
    com.springsource.slf4j.jcl-1.5.0.jar
    com.springsource.slf4j.jcl-sources-1.5.0.jar
    com.springsource.slf4j.juli-1.5.0.jar
    com.springsource.slf4j.juli-sources-1.5.0.jar
    com.springsource.slf4j.org.apache.commons.logging-1.5.0.jar
    com.springsource.slf4j.org.apache.commons.logging-sources-1.5.0.jar
    org.springframework.security-2.0.4.A.jar
    org.springframework.security.annotation-2.0.4.A.jar
    org.springframework.security.annotation-sources-2.0.4.A.jar
    org.springframework.security-sources-2.0.4.A.jar
    mauricio@mobile:~$
    and the bundle I (try to) deploy having a dependency on it:

    Code:
    --fragment of my MANIFEST.MF taken directly from the jar--
    Import-Package: 
    javax.annotation
    ,javax.persistence
    ...
    ,org.springframework.beans;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.beans.factory.config;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.context.annotation;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.context.support;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.dao;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.dao.annotation;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.orm.hibernate3;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.orm.hibernate3.annotation;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.orm.hibernate3.support;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.security;version="[2.0.4,2.0.4]";resolution:="optional"
    ,org.springframework.security.context;version="[2.0.4,2.0.4]";resolution:="optional"
    ,org.springframework.security.userdetails;version="[2.0.4,2.0.4]";resolution:="optional"
    ,org.springframework.stereotype;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.test;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.transaction.annotation;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.transaction.interceptor;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.util;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    ,org.springframework.validation;version="[2.5.6.SEC01,3.0.0)";resolution:="optional"
    why I do not see the bundle using the console:

    Code:
    osgi> sl org.springframework.security
    Cannot find bundle org.springframework.security
    and receive this error message?

    Code:
    [2009-05-20 19:14:18.354] server-dm-5              <SPDE0020E> Application context creation failure for bundle 'org.helianto.core.shared_services'.
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
    Offending resource: URL [bundleentry://83/META-INF/spring/security.xml]
    
    	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    ...
    The context mentioned is:

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:security="http://www.springframework.org/schema/security"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
          http://www.springframework.org/schema/security 
          http://www.springframework.org/schema/security/spring-security-2.0.4.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-2.5.xsd">  
    
    	<context:component-scan base-package="org.helianto.core.security"/>
    
    	<!--
    			Security Mgr	
    	-->
    	<bean id="securityMgr" 
    		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
    		 ...>
    
        <security:authentication-provider user-service-ref="userDetailsService"/>
    
    </beans>
    Thanks again,

    Maurício Castro
    www.helianto.org

  • #2
    You've marked all of your imports for Spring Security packages as being optional. This means that Equinox can, if it helps to wire the bundles together, drop those imports. My guess is that this is what has happened here.

    As you get an error in your application in the absence of the Spring Security bundle, I don't think that your imports of the Spring Security packages should be optional. In fact, my guess would be that almost all of your imports for org.springframework.* packages should not be optional.

    As a general rule, if your application depends upon something, a mandatory import will usually be required. It's a lot harder to write code that can optionally depend upon something (i.e. it can gracefully cope with its absence), than to write code that needs the dependency to be there for it to function. The default position when importing something should be to make the import mandatory.

    Try removing the optional attribute from your inputs, apart from the cases where you know that the import truly is optional, and then reinstall your application.

    Comment


    • #3
      Thanks Andy,

      now I see resolution=optional is not just like a lazy loading feature, as I thought. Appart from that, I noticed that I can not see the library org.springframework.spring(2.5.6.SEC01) using the bundle repository browser in STS, even after refresh (I am not behind a firewall). Please check the attached screenshot.

      Maurício

      Comment


      • #4
        At the moment, updating the index that the bundle repository browser uses is a somewhat manual process so, unfortunately, it isn't always as up-to-date as it could be. I've opened a new story in the dm Server tools JIRA to improve this. Thanks for the feedback.

        Comment

        Working...
        X