Pergunta

i have a software which runs on jboss and it requires crypto library which resides in jre/lib/ext. I get the following exception:

Caused by: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE from [Module "deployment.myatrium-intranet-ear.ear.myatrium_intranet.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

i have tried the following solution in this link:

http://www.liferay.com/it/community/wiki/-/wiki/Main/JBoss+AS7+tips/maximized#section-JBoss+AS7+tips-sunjce_provider.jar

but failed to get ext folder scanned.

Really in a desperate situation. A help is really appreciated.

thanks in advance

Foi útil?

Solução

I had a very similar problem a few months ago and it seems that the standard approach is not working.

This link solved my problem: https://community.jboss.org/thread/175395

It talks about the bouncycastle provider, but should work for sunjce_provider too.

Outras dicas

You have understand it wrong. JBoss 7 have migrated to full OSGi. You need to add them to boot delegations .

It indeed loads the ext in classpath. The problem is it applies a class filter (to prevent you use non-standard class).

The same problem occur if you use the ODBC driver (sun.jdbc.odbc.*) and other sun.* classes. You have to add it to boot delegration / system package. (this is not the proper way. But you seems to hate the proper way, so....)

See these pages for details:

Try putting the following:

Extension-List: crypto
crypto-Extension-Name: javax.crypto

inside the WAR/classes/META-INF/MANIFEST.MF

Usually in a war file the META-INF is inside the root of the war as in

WAR
├── WEB-INF
│   └── classes
└── META-INF   
    └── MANIFEST.MF 

The following seems to work for liferay 6.1 on jboss 7.1.1

WAR
└── WEB-INF
    └── classes
         └── META-INF
              └── MANIFEST.MF

it will work in Jboss 7, by just pointing to the jar, either using jboss-deployment-strcuture.xml or manifest entry.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top