org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jaasAuthenticationProvider' defined in class path resource [applicationContext-security.xml]: Invocation of init method failed; nested exception is java.io.IOException: File resolution not supported for nested resource: ZipEntryHandler@30251001[path=application.ear/application-main-4.5.0.jar/auth.conf context=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/application.ear/application-main-4.5.0.jar/auth.conf]

Spring JIRA | Morley Howell | 6 years ago
  1. 0

    Here is a snippet of my security config file showing my declaration of the JaasAuthenticationProvider: <b:bean id="jaasAuthenticationProvider" class="org.springframework.security.authentication.jaas.JaasAuthenticationProvider"> <b:property name="loginConfig" value="classpath:auth.conf" /> ... </b:bean> Here is the exception thrown when starting up the application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jaasAuthenticationProvider' defined in class path resource [applicationContext-security.xml]: Invocation of init method failed; nested exception is java.io.IOException: File resolution not supported for nested resource: ZipEntryHandler@30251001[path=application.ear/application-main-4.5.0.jar/auth.conf context=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/application.ear/application-main-4.5.0.jar/auth.conf] at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389) Digging through the Spring code, I found that the exception is being thrown from the getFile() method of VfsUtils, which is called from VfsResource.getFile(). Apparently under JBoss, the classpath resource is resolved to a VfsResource. The first line of the method JaasAuthenticationProvider.convertLoginConfigToUrl() calls loginConfig.getFile().getAboslutePath(). Looking at the code in VfsUtils, it appears that the version of the JBoss VFS used with JBoss 5 doesn't support the getFile() method, and throws the IOException noted above. Even if it weren't for this problem, the code in JaasAuthenticationProvider.convertLoginConfigToUrl() appears to assume that the loginConfig is a file in the file system. Any other type of resource looks as though it would not work. To test this theory, I wrote a subclass of JaasAuthenticationProvider, and replaced the convertLoginConfigToUrl method with the following code: private String convertLoginConfigToUrl() throws IOException { return getLoginConfig().getURL().toString(); } This solved my problem.

    Spring JIRA | 6 years ago | Morley Howell
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jaasAuthenticationProvider' defined in class path resource [applicationContext-security.xml]: Invocation of init method failed; nested exception is java.io.IOException: File resolution not supported for nested resource: ZipEntryHandler@30251001[path=application.ear/application-main-4.5.0.jar/auth.conf context=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/application.ear/application-main-4.5.0.jar/auth.conf]
  2. 0

    Here is a snippet of my security config file showing my declaration of the JaasAuthenticationProvider: <b:bean id="jaasAuthenticationProvider" class="org.springframework.security.authentication.jaas.JaasAuthenticationProvider"> <b:property name="loginConfig" value="classpath:auth.conf" /> ... </b:bean> Here is the exception thrown when starting up the application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jaasAuthenticationProvider' defined in class path resource [applicationContext-security.xml]: Invocation of init method failed; nested exception is java.io.IOException: File resolution not supported for nested resource: ZipEntryHandler@30251001[path=application.ear/application-main-4.5.0.jar/auth.conf context=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/application.ear/application-main-4.5.0.jar/auth.conf] at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389) Digging through the Spring code, I found that the exception is being thrown from the getFile() method of VfsUtils, which is called from VfsResource.getFile(). Apparently under JBoss, the classpath resource is resolved to a VfsResource. The first line of the method JaasAuthenticationProvider.convertLoginConfigToUrl() calls loginConfig.getFile().getAboslutePath(). Looking at the code in VfsUtils, it appears that the version of the JBoss VFS used with JBoss 5 doesn't support the getFile() method, and throws the IOException noted above. Even if it weren't for this problem, the code in JaasAuthenticationProvider.convertLoginConfigToUrl() appears to assume that the loginConfig is a file in the file system. Any other type of resource looks as though it would not work. To test this theory, I wrote a subclass of JaasAuthenticationProvider, and replaced the convertLoginConfigToUrl method with the following code: private String convertLoginConfigToUrl() throws IOException { return getLoginConfig().getURL().toString(); } This solved my problem.

    Spring JIRA | 6 years ago | Morley Howell
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jaasAuthenticationProvider' defined in class path resource [applicationContext-security.xml]: Invocation of init method failed; nested exception is java.io.IOException: File resolution not supported for nested resource: ZipEntryHandler@30251001[path=application.ear/application-main-4.5.0.jar/auth.conf context=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/application.ear/application-main-4.5.0.jar/auth.conf]
  3. 0

    Cannot start MarketDataStarter

    Google Groups | 5 years ago | Tamas Jozsa
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TransactionService' defined in class path resource [applicationContext-export-remoteServices.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: internal error: ObjID already in use****
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [NMS-7076] OpenNMS does not start on Windows - The OpenNMS Issue Tracker

    opennms.org | 12 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
  6. 0

    OpenNMS / Mailing Lists

    sourceforge.net | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'init-capsdConfig-factory' defined in class path resource [META-INF/opennms/applicationContext-commonConfigs.xml]: Invocation of init method failed; nested exception is org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor for 'service' in ClassDescriptor of capsd-configuration{File: [not available]; line: 194; column: 74}

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.beans.factory.BeanCreationException

      Error creating bean with name 'jaasAuthenticationProvider' defined in class path resource [applicationContext-security.xml]: Invocation of init method failed; nested exception is java.io.IOException: File resolution not supported for nested resource: ZipEntryHandler@30251001[path=application.ear/application-main-4.5.0.jar/auth.conf context=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/tools/jboss-5.1.0.GA/server/default/deploy/application.ear/application-main-4.5.0.jar/auth.conf]

      at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory()
    2. Spring Beans
      SingletonBeanFactoryLocator.useBeanFactory
      1. org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389)
      1 frame