AnsweredAssumed Answered

Sun AppServer Alfresco issues

Question asked by erwinv on Jan 13, 2006
Latest reply on Jan 17, 2006 by steve
After trying to install the WAR version of alfresco on Sun AppServer 8.1, the following exception shows up, preventing the application context from starting.


Context initialization failed
java.lang.ExceptionInInitializerError"

(full trace below)

The exception in turn is caused by:

Caused by: java.security.AccessControlException: access denied (java.security.SecurityPermission putProviderProperty.CryptixCrypto)

(see trace again)

Tried Adding the following to server.policy:


// Alfresco addition
grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-modules/alfresco/-" {
     permission java.security.SecurityPermission "putProviderProperty.CryptixCrypto";
};

which didn't do anything…

Ultimately, the exception is caused by the static initialization block in org/alfresco/repo/security/authentication/MD4PasswordEncoderImpl:


    static
    {
        try
        {
            MessageDigest.getInstance("MD4");
        }
        catch (NoSuchAlgorithmException e)
        {
            Security.addProvider(new CryptixCrypto());
        }
    }

i.e. when no other MD4 implementation is present, it defaults to Cryptix.

Any hints as to how to fix this?

         Erwin

Stack trace from server.log:


[#|2006-01-13T09:13:32.507-0700|INFO|sun-appserver-ee8.1|javax.enterprise.system.stream.out|_ThreadID=10;|09:13:32,505 ERROR [web.context.ContextLoader] Context initialization failed
java.lang.ExceptionInInitializerError
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:242)
   at org.springframework.util.ClassUtils.forName(ClassUtils.java:86)
   at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:61)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:332)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:298)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:235)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:184)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:188)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:146)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.importBeanDefinitionResource(DefaultXmlBeanDefinitionParser.java:268)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:226)
   at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:184)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:188)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:146)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:99)
   at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:114)
   at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:82)
   at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:260)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:133)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4010)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4525)
   at com.sun.enterprise.web.WebModule.start(WebModule.java:241)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1086)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:833)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1086)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:483)
   at org.apache.catalina.startup.Embedded.start(Embedded.java:894)
   at com.sun.enterprise.web.WebContainer.start(WebContainer.java:688)
   at com.sun.enterprise.web.HttpServiceWebContainer.startInstance(HttpServiceWebContainer.java:889)
   at com.sun.enterprise.web.HttpServiceWebContainerLifecycle.onStartup(HttpServiceWebContainerLifecycle.java:50)
   at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:300)
   at com.sun.enterprise.server.PEMain.run(PEMain.java:294)
   at com.sun.enterprise.server.PEMain.main(PEMain.java:220)
Caused by: java.security.AccessControlException: access denied (java.security.SecurityPermission putProviderProperty.CryptixCrypto)
   at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
   at java.security.AccessController.checkPermission(AccessController.java:427)
   at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
   at java.lang.SecurityManager.checkSecurityAccess(SecurityManager.java:1698)
   at java.security.Provider.check(Provider.java:349)
   at java.security.Provider.put(Provider.java:303)
   at cryptix.jce.provider.CryptixCrypto.<init>(CryptixCrypto.java:54)
   at org.alfresco.repo.security.authentication.MD4PasswordEncoderImpl.<clinit>(MD4PasswordEncoderImpl.java:57)
   … 38 more
|#]

Outcomes