-
1. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
ybxiang.china Aug 8, 2013 1:35 AM (in response to sunilml21)I think you need to configure your security domain in standalon.xml at first.
You can NOT just throw your applictions into jboss AS 7 deployments directory.
-
2. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
sfcoy Aug 8, 2013 2:52 AM (in response to sunilml21)1 of 1 people found this helpfulI wrote a test bean
{code:java}@Startup
@Singleton
public class NoSuchAlgorithmExceptionTestBean {
private final Logger logger = Logger.getLogger(NoSuchAlgorithmExceptionTestBean.class.getName());
@PostConstruct
void startup() throws NoSuchAlgorithmException {
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEwithMD5andDES");
logger.info("Started");
}
}{code}
which deploys and runs on every version of AS 7 between 7.0.2 and 7.2.0 with no additional server configuration or custom modules.
So it looks like you have broken something somewhere. It seems like your custom module is redundant, at least when running Sun/Oracle Java.
-
3. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
sunilml21 Aug 8, 2013 3:06 AM (in response to sfcoy)Hi Stephen,
I created custom module for jre libraries[sunjce_provider.jar, local_policy.jar] since I was getting java.lang.NoClassDefFoundError otherwise. Is there any other way include jre libraries?
-
4. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
sfcoy Aug 8, 2013 3:12 AM (in response to sunilml21)Exactly which class is not found?
What Java implementation are you running? Please show the output of "java -version".
Also, which version of JBossAS/WildFly are you running?
-
5. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
sunilml21 Aug 8, 2013 3:46 AM (in response to sfcoy)Sorry. I was wrong. I tried again by removing custom module for jre libraries. I am not getting NoClassDefFoundError. But I am still getting NoSuchAlgorithmException even after removing redundant custom module.
Also I tried to create SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEwithMD5andDES"); in a test project as you did. I got the intance of SecretKeyFactory without any error!
Now I am sure that I have messed up some configuration in my actual project. I will try to redeploy by removing unnecessary module configurations and post my results here.
-
6. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
sunilml21 Aug 8, 2013 8:20 AM (in response to sunilml21)Hi,
I solved this problem by adding dependency in module.xml of my custom module
<dependencies>
<module name="javax.api" slot="main" export="true" />
</dependencies>
The code SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEwithMD5andDES"); was in one of the jar which was in my custom module. So it was not able to find that algorithm which was actually present in jre library. It started working once I added above dependency configuration for my custom module.
It was working in test project since jre libraries were available directly to the test war that I deployed.
I was actually getting NoClassDefFoundError for the classes present in jsse.jar and jce.jar. I included these jars by creating modules. I hope this is the correct way to include them. Please correct me if I am wrong.
-
7. Re: java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7
sfcoy Aug 8, 2013 8:46 AM (in response to sunilml21)Sunil M L wrote:
...
I was actually getting NoClassDefFoundError for the classes present in jsse.jar and jce.jar. I included these jars by creating modules. I hope this is the correct way to include them. Please correct me if I am wrong.
I think you just need to add a dependency on the sun.jdk module.