cancel
Showing results for 
Search instead for 
Did you mean: 

Module Processor : Module exception java.lang.ClassCastException

Former Member
0 Kudos

Hello,

I am trying to understand how the Module processor works for our custom module exits.

So, using NW Dev. Studio, I created a EJB project with an EJB module Local interface. In the bean class, I have process() method and everything is same as the example module ConvertCRLFfromToLF provided by SAP (except the class name and the package).

My ejb-jar.xml looks like this

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"

"http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar>

<description>EJB JAR description</description>

<display-name>EJB JAR</display-name>

<enterprise-beans>

<session>

<ejb-name>MYConvertCRLFfromToLFBean</ejb-name>

<home>com.sap.aii.af.mp.module.ModuleHome</home>

<remote>com.sap.aii.af.mp.module.ModuleRemote</remote>

<local-home>com.sap.aii.af.mp.module.ModuleLocalHome</local-home>

<local>com.sap.aii.af.mp.module.ModuleLocal</local>

<ejb-class>com.kk.Adapter.Module.File.MYConvertCRLFfromToLFBean</ejb-class>

<session-type>Stateless</session-type>

<transaction-type>Container</transaction-type>

</session>

</enterprise-beans>

</ejb-jar>

The ejb-j2ee-engine.xml looks like

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">

<ejb-j2ee-engine>

<enterprise-beans>

<enterprise-bean>

<ejb-name>MYConvertCRLFfromToLFBean</ejb-name>

<jndi-name>KK/MYConvertCRLFfromToLFBean</jndi-name>

<session-props/>

</enterprise-bean>

</enterprise-beans>

</ejb-j2ee-engine>

I am deploying this bean using NW Dev Studio.

In the module process or Sender File Adapter, I have provided the following

1. localejbs/KK/MYConvertCRLFfromToLFBean

2. localejbs/CallSapAdapter

After activating the comm. channel, I get the following error

"Error: Module exception java.lang.ClassCastException found"

However, if I use SAP's example module localejbs/SAP XI Sample/ConvertCRLFfromToLF, the same works OK.

I don't know what I am missing here. Any help will be highly appreciated.

Thanks

KK

Message was edited by: KK

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi KK -

Another option for deployment, especially for your example, is using the SDM tool. Ulitimately this is how the sample module you're working with was deployed during the XI installation. There is a corresponding 'sample_module.sda' in the file system at:

\usr\sap\<SID>\DVEBMGS00\SDM\root\origin\sap.com\com.sap.aii.af.sample.module\SAP AG\3.0.1120050323100537.0000

OR (for a Web AS Java)

\usr\sap\<SID>\JC00\SDM\root\origin\sap.com\com.sap.aii.af.sample.module\SAP AG\3.0.1120050221120510.0000

Note that the 3.0.XXXXXXXXXXXXXXXX.XXXX will vary depending on the particular patch/SP.

Open up the .sda file with winzip and adjust it to your needs. You can use SDM to deploy the adjusted .sda. It may also help you troubleshoot your NWDS deployment.

Regards,

Jin

Former Member
0 Kudos

Hi Jin/KK,

Even I am getting the ClassCastException.

I deployed the module processor using the SDM only. The module processor that I have deployed is not much different from the Sample Module. However still I am getting this exception.

How did you guys solve this problem ? I checked the application log and the trace file. However I could not get additional info regarding this (except the Class Cast Exception). Any pointers to this would be extremely useful.

Thanks and Regards.

Former Member
0 Kudos

Mustafa,

I solved the problem I was facing with ClassCastException. By mistake, I had included the module jar files in my application instead of just a reference.

So the jar files got included in the EAR file, which caused this error (Because the class loaders are different).

May be this is applicable in your case as well. Try referencing them instead of adding them to your application.

Thanks

KK

Former Member
0 Kudos

Hi KK,

I created the TestModule.sda file with TestModule.jar and META-INF directory. (command jar -cvf TestModule.sda TestModule.jar META-INF). Even the sample_module.sda file that came with the installation had the same file structure.

Surprisingly the sample module which is automatically deployed while installing XI is also giving the ClassCastException when I try to refer it in the module tab by its jndi ("SAP XI Sample/ConvertCRLFfromToLF")name.

Can you please give more info on the way you referred it. How were these files (jar and META-INF) organised when you created the sda file. And where did you referred this jar file (In my case I referred this TestModule.jar name in the application.xml in the META-INF directory of the sda file).

How did you deployed the sda file that you created. I deployed it using the SDM. Is there any other way you adopted to deploy this file.

Thanks and Regards.

Former Member
0 Kudos

Hi Mustafa -

I'm assuming you changed the package name and the name of the class. Given this, you have to make the corresponding changes in the following files within the sda:

Sap_manifest.mf

application.xml

com.sap.aii.af.sample.module-dd.xml (this file is referred to in Sap_manifest.mf. To be consistent, change the name of the file to <your package>-dd.xml and make the adjusted reference in Sap_manifest.mf).

log-configuration.xml

I'll admit that there's a lot of room for human error here so double check all your files and references. Once you have it right once, it's not too bad.

Jin

Former Member
0 Kudos

Hi KK

Well what I can get out of this is only this. Some where u need to cast your class(user defined ) into type module precessor expecting.

Even I do not have any idea where it is to done ..

thanx & regards

Vinod Ahir