-
1. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
fuinhaazul Mar 19, 2012 10:48 AM (in response to fuinhaazul)Tryed with the latest jboss 7.1.2 and the problem still exists.
to simulate, just add on a method "XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");" or use the static reference on the first example.
This is an issue or I need to import some another module on MANIFEST.MF ?
-
2. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
jason.greene Mar 19, 2012 12:20 PM (in response to fuinhaazul)Can you give an overview of your application's structure? Are you packaging an xml security implementation in your app?
-
3. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
jason.greene Mar 19, 2012 12:24 PM (in response to fuinhaazul)BTW I see problems on our side, I just want to make sure I understand how you are using it.
-
4. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
fuinhaazul Mar 19, 2012 1:51 PM (in response to jason.greene)Sure,
My structure is:
An EJB TimerService that will sign a XML with a digital certificate. All by "scratch". There is no deployment descritors.
The app:
myapp.ear
lib
myutilclasses.jar
myapp.war (some rest services)
lib
primefaces.jar
myapp.jar (Some TimerServices, some Assynchronous EJB invocation and stored procedures calls)
EAR MANIFEST (the others are empty)
Dependencies: org.apache.log4j export,com.nl.ed export,oracle.jdbc export,org.jboss.ironjacamar.jdbcadapters export,javax.mail.api export
On jboss modules (I created my own module) i have some extra libraries:
ojdbc6.jar, barbecue.jar, commons-digester.jar, itext.jar, jasperreports.jar, jasypt.jar, pdfrenderer.jar
But:
Try to deploy an single EJB module on jboss as7 with this class, and the problem will happen:
package TesteTimer;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.ejb.ScheduleExpression;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.ejb.Timeout;
import javax.ejb.TimerService;
import javax.xml.crypto.dsig.XMLSignatureFactory;
@Singleton
@Startup
public class TimerClass {
@Resource
TimerService timerService;
@PostConstruct
public void initialize() {
ScheduleExpression expression = new ScheduleExpression();
expression.second("*/1").minute("*").hour("*");
timerService.createCalendarTimer(expression);
}
@Timeout
public void execute() {
System.out.println("BEFORE EXCEPTION");
XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
System.out.println("AFTER EXCEPTION");
}
}
Thansk for your help!
-
5. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
giama Mar 21, 2012 5:49 AM (in response to fuinhaazul)I have same exception on jas 7.1.1 final.
Artifacts buided as jar (EJB3), running with jdk 1.6.0_31.
Did you find any solution?
Thanks a lot
-
6. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
fuinhaazul Mar 21, 2012 7:28 AM (in response to giama)Yes
The solution was fallback to AS6.1 ....
For my project AS 7.1 has 2 major problems that make impossible to use (see my other post about server shutdown) .
Maybe later I will open an jira and post the link here.
-
7. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
giama Mar 21, 2012 7:36 AM (in response to fuinhaazul)i can't fallback...
i'm porting a project from jboss 4.2.3 to as7.. it's very very hard to do... i solved several problem. i can't believe this classcast is unsolvable... it's just a classcast...
i just tried to cast to new class the getInstance statement
org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory signatureFactory = (org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory) XMLSignatureFactory.getInstance("DOM"); who tried this? i'm getting same exception.. but i think it's impossible.. what's wrong?
-
8. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
swd847 Mar 21, 2012 8:09 AM (in response to giama)What would help us to resolve your problem is to post the details of your application structure.
Also if would help if you could set a ClassCastException breakpoint in your IDE, and report the two different class loaders that are causing the problem(i.e. the expected class loader and the actual class loader).
-
9. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
giama Mar 21, 2012 10:04 AM (in response to swd847)What application details do you need Stuart?
This is the stack trace
13:30:24,333 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
13:30:24,349 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at javax.xml.crypto.dsig.XMLSignatureFactory.findInstance(XMLSignatureFactory.java:202)
13:30:24,349 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at javax.xml.crypto.dsig.XMLSignatureFactory.getInstance(XMLSignatureFactory.java:186)
13:30:24,349 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.gpi.hbook.util.DetachedDigitalSignature.validate(DetachedDigitalSignature.java:326)
I saw that XMLSignatureFactory.java:202 doesn't correspond to correct line to XMLSignatureFactory contained into running JVM rt.jar. Seems to me that jboss runtime use the one contained into module org\apache\santuario\xmlsec. This module contains xmlsec-1.5.1.jar: is this a stable version?
jira created https://issues.jboss.org/browse/AS7-4248
-
10. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
giama Mar 21, 2012 9:49 AM (in response to giama)i think i solved...
but not in a canonical approach and i hope a patch will be done...
i replaced xmlsec-1.5.1.jar with the previous version xmlsec-1.4.6.jar and correct relative module.xml in org\apache\santuario\xmlsec\main and now it works.
Seems to me that last santuario has something wrong: anyone know something about?
-
12. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
asoldano Apr 4, 2012 5:40 AM (in response to giama)There's been some refactoring in Santuario 1.5 which imply changes to be applied on the JBoss AS modules. See pull request in AS7-4248.
-
13. Re: AS7 7.1.1.Final: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
dragos.n Oct 16, 2012 7:49 AM (in response to fuinhaazul)Hi,
Is this problem solved? I have the same problem whit JBoss 7.1.1.
java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
Is the approach of downgrade the xmlsec module to xmlsec-1.4.6.jar ?