cancel
Showing results for 
Search instead for 
Did you mean: 

ClassCastException using Moduleprocessor

Former Member
0 Kudos

Hi, all!

I' ve got a problem with Moduleprocessor for XI:

1. I created a stateless Session-EJB (remote & local interface) in NWDS which implements the com.sap.aii.af.mp.module.Module interface and added an empty process()-Method.

2. I then built an EJB Jar-Archive.

3. Afterwardss I created an Enterprise Application and added my EJB Module to it.

4. I finally built an Application Archive and deployed it to the J2EE-server via NWDS SDM.

5. A collegue of mine added the Beans JNDI-name to the Mail-Adapter of the XI.

6. When sending a mail, a ClassCastException is thrown:

error occured: [2006-01-17T07:18:38Z] 2 new messages found among 35 messages in total; processing message 34exception caught during processing mail message [34]com.sap.aii.af.mp.processor.ModuleProcessorException: Processing Error caused by: java.lang.ClassCastException; processing message 35exception caught during processing mail message [35]com.sap.aii.af.mp.processor.ModuleProcessorException: Processing Error caused by: java.lang.ClassCastException; action[s] taken

Could anybody help me with that matter?

Thanks a lot in advance!

BR

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Did you Refer the module jar or Included them (if you have included then it gets in your ear file, so it gets an error as class loaders are different).

You need to refer the module jars.

simlilar thread:

Regards,

Anirban.

Former Member
0 Kudos

Hi!

To be honest: I' m a newbie and don' t really know whether I included or referred to the jar. What I did is creating an Enterprise Project and then - from the context menu of 'application.xml' - said 'Add Module' choosing the newly created EJB Project.

Am I missing something?

Regards, Thomas

Former Member
0 Kudos

Hi,

In NDS , use File -->New -->Enterprise application project, then add project name, then click NEXT And Not Finish,

You get the screen Referenced Projects, choose and refer HERE, by clicking on the check box.Then select finish.

Did you do like this? Just give it a try.

Regards,

Anirban.

Former Member
0 Kudos

Hi!

Yes, that' s exactly what I did. Any ideas?

Regards,

Thomas

Former Member
0 Kudos

Hi,

On the previous message you wrote that you "added from context of the application.xml"

Donot ADD Module like that,

Refer it while you create it as i said above.

This might be a bit confusing, but please again ensure you did not add from context of application.xml

Meanwhile i am looking at my own modules and thinking what else can be the reason.

Regards,

Anirban.

stefan_grube
Active Contributor
0 Kudos

Open the created EAR file with WinZip und check, if the library jars are included. If this is the case, then delete it. Only the jar file of your application is allowed.

Regards

Stefan

Former Member
0 Kudos

Hi, Stefan!

Thanks for your answer! If I do so, the following Exception is thrown while deployment:

Result

=> deployment aborted : file:/C:/DOKUME1/TW/LOKALE1/Temp/temp48477Spardat SMime App.ear

Aborted: development component 'Spardat SMime App'/'snap.at'/'localhost'/'2006.01.17.10.55.04':

Caught exception during application deployment from SAP J2EE Engine's deploy service:

java.rmi.RemoteException: Cannot deploy application snap.at/Spardat SMime App.. Reason: Exception during generation of components of application snap.at/Spardat SMime App in container EJBContainer.; nested exception is: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception during generation of components of application snap.at/Spardat SMime App in container EJBContainer.

(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

Regards,

Thomas

Former Member
0 Kudos

Hi, Anirban!

I did like you told me, but unfortunatly it still doesn't work. Are probably any settings in the deployment descriptor(s) necessary?

Once again thank you very much for your kind efforts!

Regards,

Thomas

Former Member
0 Kudos

Hi,

My last shot at your issues,

1.Donot change anything as of now as you are not sure of the issues that may come.

2.Logon to https://websmp106.sap-ag.de/nw-howtoguides

3.Download HowToCreateAdapterModules.pdf

Sounds a bit elaborate but please do it as i reached myself in module devlopement by this.

4.Follow step by step(create a new project for this) and i am sure you will hit success.

It was nice talking to you and you have a great virtue of patience, keep it up.

Bye,

Anirban.

Former Member
0 Kudos

Hi!

Thanks for the hint and all previous info - it finally worked!

Regards

Thomas

Former Member
0 Kudos

Hi Thomas,

Thats nice to know,great.

Regards,

Anirban.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Thomas,

Check ejb-jar.xml file, whether you have included correct references or not.I mean instead of refering your interfaces give references on Server and remove the jar files(only those for which you have given reference in application-j2ee-engine.xml) from your .Ear project.

In ejb-jar.xml reference to interfaces should look like this -

<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>

I hope it will solve your problem(not sure).Previously i also got this error and got solved when change ejb-jar.xml.

regards,

Gowtham K.

Former Member
0 Kudos

Hi Thomas,

I think the problem is in your code of process method().

The process() should return an object type ModuleData.So the syntax should be like this

public ModuleData process(

ModuleContext moduleContext,

ModuleData inputModuleData)

throws ModuleException{

//Write your code here.

return inputModuleData;

}

If it is same like above, then the problem will be in the code you have written in process();

regards,

Gowtham K.

Former Member
0 Kudos

Hi, Gowtham!

I implemented the process-Method without additional code except the return inputModuleData-statement and it threw the Exception.

Are there any additional settings to be made in the deployment descriptors or adaptions in the Home/Remote/LocalHome/Locale-Interfaces?

Regards,

Thomas

MichalKrawczyk
Active Contributor
0 Kudos

Hi Thomas,

most probably the JNDI-name is not correct

check service JNDI in the visual Admin to see

if such a JNDI-name exits

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Former Member
0 Kudos

Hi, Michal!

Thanks for answering.

I copied the JNDI-name out of Visual Admin and pasted it into the integration builder (prefixed with 'localejbs').

Regards,

Thomas