Announcement Announcement Module
Collapse
No announcement yet.
cannot find net.sf.acegisecurity.acl.basic.SimpleAclEntryExc Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • cannot find net.sf.acegisecurity.acl.basic.SimpleAclEntryExc

    Hi,

    I am in the process of adding acegi to my project. First I added form authentication and hibernate stuff, everything was ok. Now I added acl authorization and I am encoutering an exception at startup:

    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'net.sf.acegisecurity.acl.basic.SimpleAclEntry.REA D' defined in file [C:\projects\emailargs\common\wcvs\..\..\web\wcvs\w ebroot\web-inf\applicationContext-zec-acegi-acl.xml]: Initialization of bean failed; nested exception is java.lang.ClassNotFoundException:
    net.sf.acegisecurity.acl.basic.SimpleAclEntry
    java.lang.ClassNotFoundException:
    net.sf.acegisecurity.acl.basic.SimpleAclEntry
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at org.springframework.util.ClassUtils.forName(ClassU tils.java:74)
    at org.springframework.beans.factory.config.FieldRetr ievingFactoryBean.afterPropertiesSet(FieldRetrievi ngFactoryBean.java:163)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1075)
    ...

    My code looks like this:
    String springconfig = "../../web/wcvs/webroot/web-inf/application*.xml";
    //test
    Object o = Class.forName("net.sf.acegisecurity.acl.basic.Simp leAclEntry");
    System.out.println(o);
    ApplicationContext context = new FileSystemXmlApplicationContext(springconfig);

    Notice that the testing line finds the class net.sf.acegisecurity.acl.basic.SimpleAclEntry (I dont know if that means anything, I am new to spring)

    and I have these spring files:
    applicationContext-acegi-security.xml
    applicationContext-hibernate.xml
    applicationContext-resources.xml
    applicationContext-service.xml
    applicationContext-zec-acegi-acl.xml

    any clues?

    thanks in advance
    javi

  • #2
    Sounds like a classloader issue to me, as in your have a Spring-related JAR or Acegi Security-related JAR somewhere in your classloader aside from the WAR's WEB-INF/lib directory. Perhaps double-check there aren't extra JARs laying around in your container's shared library directories. If that doesn't work, please post applicationContext-zec-acegi-acl.xml so we can take a look.

    Comment


    • #3
      Originally posted by Ben Alex
      Sounds like a classloader issue to me, as in your have a Spring-related JAR or Acegi Security-related JAR somewhere in your classloader aside from the WAR's WEB-INF/lib directory. Perhaps double-check there aren't extra JARs laying around in your container's shared library directories. If that doesn't work, please post applicationContext-zec-acegi-acl.xml so we can take a look.
      Hi Ben,

      As I realized that no acegi security code is involved in the exception (apart from the not found class), I had repost the question on core-container forum, but got no solution yet....

      My code runs as a standalone program, no webapp. I have checked all my jars and only have spring1.2rc1 and acegi security0.8.1 jars on the classpath. Running it on java1.5

      I attach applicationContext-acegi-acl.xml (I had changed the name to applicationContext-zec-acegi-acl.xml to check wether it had something to do with alphabetical order of the config files).

      thanks,
      javi

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

      <!--
      - Application context containing authentication beans.
      -
      -->

      <beans>

      <!-- ~~~~~~~~~~~~~~~~~~ "BEFORE INVOCATION" AUTHORIZATION DEFINITIONS ~~~~~~~~~~~~~~~~ -->

      <!-- ACL permission masks used by this application -->
      <!-- READ: all non destructive actions for Query -->
      <bean id="net.sf.acegisecurity.acl.basic.SimpleAclEntry. READ"
      class="org.springframework.beans.factory.config.Fi eldRetrievingFactoryBean">
      <property name="staticField">
      <value>
      net.sf.acegisecurity.acl.basic.SimpleAclEntry.READ
      </value>
      </property>
      </bean>
      <!-- DELETE: can delete emails from the Query -->
      <bean id="net.sf.acegisecurity.acl.basic.SimpleAclEntry. DELETE"
      class="org.springframework.beans.factory.config.Fi eldRetrievingFactoryBean">
      <property name="staticField">
      <value>
      net.sf.acegisecurity.acl.basic.SimpleAclEntry.DELE TE
      </value>
      </property>
      </bean>


      <!-- An access decision voter that reads ACL_CONTACT_READ configuration
      settings -->
      <bean id="aclContactReadVoter"
      class="net.sf.acegisecurity.vote.BasicAclEntryVote r">
      <property name="processConfigAttribute">
      <value>ACL_CONTACT_READ</value>
      </property>
      <property name="processDomainObjectClass">
      <value>com.galeon.emailargs.common.gendb.model.Que ry</value>
      </property>
      <property name="aclManager">
      <ref local="aclManager" />
      </property>
      <property name="requirePermission">
      <list>
      <ref
      local="net.sf.acegisecurity.acl.basic.SimpleAclEnt ry.READ" />
      <ref
      local="net.sf.acegisecurity.acl.basic.SimpleAclEnt ry.DELETE" />
      </list>
      </property>
      </bean>

      <!-- An access decision voter that reads ACL_CONTACT_DELETE configuration settings -->
      <bean id="aclContactDeleteVoter"
      class="net.sf.acegisecurity.vote.BasicAclEntryVote r">
      <property name="processConfigAttribute">
      <value>ACL_CONTACT_DELETE</value>
      </property>
      <property name="processDomainObjectClass">
      <value>com.galeon.emailargs.common.gendb.model.Que ry</value>
      </property>
      <property name="aclManager">
      <ref local="aclManager" />
      </property>
      <property name="requirePermission">
      <list>
      <ref
      local="net.sf.acegisecurity.acl.basic.SimpleAclEnt ry.DELETE" />
      </list>
      </property>
      </bean>

      <!-- An access decision manager used by the business objects -->
      <bean id="businessAccessDecisionManager"
      class="net.sf.acegisecurity.vote.AffirmativeBased" >
      <property name="allowIfAllAbstainDecisions">
      <value>false</value>
      </property>
      <property name="decisionVoters">
      <list>
      <ref bean="roleVoter" />
      <ref local="aclContactReadVoter" />
      <ref local="aclContactDeleteVoter" />
      </list>
      </property>
      </bean>

      <!-- ========= ACCESS CONTROL LIST LOOKUP MANAGER DEFINITIONS ========= -->

      <bean id="aclManager"
      class="net.sf.acegisecurity.acl.AclProviderManager ">
      <property name="providers">
      <list>
      <ref local="basicAclProvider" />
      </list>
      </property>
      </bean>

      <bean id="basicAclProvider"
      class="net.sf.acegisecurity.acl.basic.BasicAclProv ider">
      <property name="basicAclDao">
      <ref local="basicAclExtendedDao" />
      </property>
      </bean>

      <bean id="basicAclExtendedDao"
      class="net.sf.acegisecurity.acl.basic.jdbc.JdbcExt endedDaoImpl">
      <property name="dataSource">
      <ref bean="dataSource" />
      </property>
      </bean>

      <!-- ================= METHOD INVOCATION AUTHORIZATION ==================== -->

      <!--
      The create, getAll, getById etc have ROLE_USER to ensure user is
      authenticated (all users hold ROLE_USER in this application).

      The delete and update methods don't need a ROLE_USER as they will
      ensure the user is authenticated via their ACL_CONTACT_DELETE or
      ACL_CONTACT_READ attribute, which also ensures the user has permission
      to the Contact presented as a method argument.
      -->
      <bean id="queryManagerSecurity"
      class="net.sf.acegisecurity.intercept.method.aopal liance.MethodSecurityInterceptor">
      <property name="authenticationManager">
      <ref bean="authenticationManager" />
      </property>
      <property name="accessDecisionManager">
      <ref local="businessAccessDecisionManager" />
      </property>
      <property name="objectDefinitionSource">
      <value>
      com.galeon.emailargs.common.gendb.model.QueryManag er.secRead=ACL_CONTACT_READ
      com.galeon.emailargs.common.gendb.model.QueryManag er.secDelete=ACL_CONTACT_DELETE
      </value>
      </property>
      </bean>

      </beans>

      Comment


      • #4
        I think it's a CR/LF issue.

        See http://forum.springframework.org/viewtopic.php?t=4071

        Try:

        Code:
           <bean id="net.sf.acegisecurity.acl.basic.SimpleAclEntry.ADMINISTRATION" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
              <property name="staticField"><value>net.sf.acegisecurity.acl.basic.SimpleAclEntry.ADMINISTRATION</value></property>
           </bean>
        If this works, please log a JIRA bug report for FieldRetrievingFactoryBean's handling of whitespace.

        Comment


        • #5
          Hi Ben,

          Yes, that is the case, I have found it and reported in the other thread I opened on the Core container forum, I forgot to mention it here. I filled the bug.

          thanks,
          javi

          Comment

          Working...
          X