cancel
Showing results for 
Search instead for 
Did you mean: 

ClassCastException: iaik.security.cipher.Blowfish

Former Member
0 Kudos

Hi,

In a iView project, PDK 5.0 and EP5.0 is used. The iView needs to use the blowfish encryption algorithm.

I created a test PAR project using blowfish encryption, and was able to make it work in PDK 5.0 (with the strong version of the iaik_jce.jar in the <tomcat>\webapps\irj\WEB-INF\plugins\portal\services\usermanagement\lib direcotry).

On the EP5 system, we have:

- deployed the strong version of the SAP Java Crypto Kit for 6.20 (iaik_jce.jar, etc.) to <J2EE>\alone\additional-lib

- made sure there is no IAIK jars in <J2EE>\alone\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\plugins\portal\services\usermanagement\lib and <J2EE>\alone\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\plugins\portal\services\usermanagement\lib\private

- verified that <J2EE>\alone\managers\library.txt contains:

library IAIKSecurity iaik_jsse.jar;iaik_jce.jar;iaik_ssl.jar;w3c_http.jar

library sap_security tc_sec_api.jar;tc_sec_core.jar;tc_sec_jni.jar

reference sap_security IAIKSecurity

- verified that <J2EE>\alone\managers\reference.txt, contains:

reference irj library:sap_security

reference irj library:IAIKSecurity

However, when we deploy the PAR to EP5 and run the iView, we get:

java.lang.ClassCastException: iaik.security.cipher.Blowfish

at javax.crypto.Cipher.getInstance(Unknown Source)

at javax.crypto.Cipher.getInstance(Unknown Source)

at com.rctest.TCrypto.doContent(TCrypto.java:21)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:127)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:285)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:231)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:475)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:285)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:524)

at com.sapportals.portal.prt.portalconnection.sapnative.DelegatedPlugIn.handleRequest(DelegatedPlugIn.java:715)

at com.sapportals.portal.prt.portalconnection.sapnative.PortalPlugIn.handleRequest(PortalPlugIn.java:138)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:648)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:147)

at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:789)

at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:636)

at com.inqmy.services.httpserver.server.Response.handle(Response.java:165)

at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1090)

at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)

at com.inqmy.core.cluster.impl3.ParserRunner.run(ParserRunner.java:30)

at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)

at java.security.AccessController.doPrivileged(Native Method)

at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:132)

We are puzzled. Why we get this ClassCastException in EP5 but not in PDK. Did we miss something? How can we get it to work on EP5?

Any help will be appreciated!

Thanks in advance!

Robert

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This was a hard problem and it seems like you've done everything I can think of correct.

I would believe the ClassCastException is caused by the fact that the classloader used by your portal application

has more than one reference to different versions of the iaik.security.cipher.Blowfish class, but I am not sure at all.

Try doing a search from the alone/ for all *.jar which contains the text Blowfish, maybe you will find some duplicate entries.

There has been some general information on classloaders and classcastexceptions posted on SDN earlier,

although not the same problem as you.

ClassCastException:

Classloaders:

Good luck with this one

Former Member
0 Kudos

Dagfinn,

I appreciate your reply!

I did as you suggested, searched for .jar that contains text "Blowfish", and removed all of them except the one in additional-lib (there were two jars in other portal components' private lib that contain text "Blowfish" -- they shouldn't really matter). Then I restarted the EP5, but still got this ClassCastException.

I understand the class loader hierarchy in EP5, and don't see any problem with the EP5 setting. So, I'm really puzzled. Did I miss something obvious?

Any other tips? Anybody else care to chip in? Many thanks in advance!

Best,

Robert