cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter Module Development (.ear Deployment)

Former Member
0 Kudos

Hi All,

i Have followed up adapter module development and landed in an error ,

i was said that i should remove of my .jar files and then deploy the .ear file which would make me error free.

But When i delete all those .jar file as shown below

Manifest.mf

Sap_manifest.mf

sda-dd.xml

aii_adapter_xi_svc.jar

aii_af_cci.jar

aii_af_cpa.jar

aii_af_mp.jar

aii_af_ms_api.jar

aii_af_ms_spi.jar

aii_af_trace.jar

aii_util_misc.jar

aii_util_xml.jar

ejb20.jar

*exception.jar*

application-j2ee-engine.xml

application.xml

XFileName_final.jar

it throws an error saying

May 31, 2008 11:35:44 AM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] ERROR:

[015]Deployment aborted

Settings

SDM host : pixxxxx

SDM port : 5xxxxxx

URL to deploy : file:/C:/DOCUME1/9000031/LOCALS1/Temp/temp44945FsriniFile_proj.ear

Result

=> deployment aborted : file:/C:/DOCUME1/9000031/LOCALS1/Temp/temp44945FsriniFile_proj.ear

Aborted: development component 'FsriniFile_proj'/'sap.com'/'localhost'/'2008.05.31.11.34.48'/'0':

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

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

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

Deployment exception : The deployment of at least one item aborted

But if i donot delete the .jar file it doesnot through error ,

but when i use the Module it gives error cast exception

kindly advice

srini

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member190389
Active Contributor
0 Kudos

what is that test.txt? could you show that too.

Former Member
0 Kudos

Hi PI Experts ,

I developed Encryption Module as William Li documents . I face the below issue in communication channel.

Error: java.lang.ClassCastException: class $Proxy3356:sap.com/XMLEncryptionEAR@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@7e2586f1@alive incompatible with interface com.sap.aii.af.lib.mp.module.ModuleLocal:library:com.sap.aii.af.lib@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@1394294@alive

Any help is appreciated on this .

Former Member
0 Kudos

Hi PI Experts ,

Any suggestions or advice .

Regards,

Sri

henrique_pinto
Active Contributor
0 Kudos

The class cast exception you get when you don't remove the .jars may be due to the fact that you're using older (or newer) .jars to build your project than the ones actually installed in the J2EE engine where you're deploying the module.

Try to get these .jars directly from the system and probably the class cast exception won't occur anymore (of course, supposing there's nothing wrong with your code itself).

Regards,

Henrique.

Former Member
0 Kudos

Guys Thxs, for all u r inputs from time to time :

I made mixed error but constant input from u guys made me to stream line errors and get output

With regards

Srini

Former Member
0 Kudos

Hi

What was the resolution for this issue java.lang.ClassCastException. Can you please share. I am getting the similar error.

Thanks

Shanth

Former Member
0 Kudos

Hello Srini

I am facing similar problem.

Appreciate if you can share the entire configuration.

Regards

Madhu

former_member190389
Active Contributor
0 Kudos

Hi,

Could you paste your ejb-jar.xml amd application-j2ee-engine.xml files?

Former Member
0 Kudos

ejb-jar.xml

<?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>JSriniFileName_FinalBean</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.sap.JFileName.JSriniFileName_FinalBean</ejb-class>

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

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

</session>

</enterprise-beans>

</ejb-jar>

application-j2ee-engine.xml

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

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

<application-j2ee-engine>

<reference

reference-type="hard">

<reference-target

provider-name="sap.com"

target-type="library">com.sap.aii.af.lib</reference-target>

</reference>

<reference

reference-type="hard">

<reference-target

provider-name="sap.com"

target-type="service">com.sap.aii.adapter.xi.svc</reference-target>

</reference>

<reference

reference-type="hard">

<reference-target

provider-name="sap.com"

target-type="service">com.sap.aii.af.svc</reference-target>

</reference>

<reference

reference-type="hard">

<reference-target

provider-name="sap.com"

target-type="service">com.sap.aii.af.cpa.svc</reference-target>

</reference>

<provider-name>sap.com</provider-name>

<fail-over-enable

mode="disable"/>

</application-j2ee-engine>

Now the error i get is :

Error: org.xml.sax.SAXParseException: Document root element is missing.

Coding

package com.sap.JFileName;

import javax.ejb.SessionBean;

import javax.ejb.SessionContext;

import javax.ejb.CreateException;

// Classes for Module development & Trace

import com.sap.aii.af.mp.module.Module;

import com.sap.aii.af.mp.module.ModuleContext;

import com.sap.aii.af.mp.module.ModuleData;

import com.sap.aii.af.mp.module.ModuleException;

import com.sap.aii.af.ra.ms.api.Message;

//import com.sap.aii.af.service.trace.Trace;

import java.util.Hashtable;

// XML parsing and transformation classes

import javax.xml.parsers.*;

import org.w3c.dom.*;

import java.io.InputStream;

import java.io.ByteArrayOutputStream;

import com.sap.aii.af.ra.ms.api.XMLPayload;

import javax.xml.transform.*;

import javax.xml.transform.Source;

import javax.xml.transform.Result;

import javax.xml.transform.dom.DOMSource;

import javax.xml.transform.stream.StreamResult;

/**

  • @ejbHome <{com.sap.JFileName.JSriniFileName_FinalHome}>

  • @ejbLocal <{com.sap.JFileName.JSriniFileName_FinalLocal}>

  • @ejbLocalHome <{com.sap.JFileName.JSriniFileName_FinalLocalHome}>

  • @ejbRemote <{com.sap.JFileName.JSriniFileName_Final}>

  • @stateless

  • @transactionType Container

*/

public class JSriniFileName_FinalBean implements SessionBean,Module {

public void ejbRemove() {

}

public void ejbActivate() {

}

public void ejbPassivate() {

}

public void setSessionContext(SessionContext context) {

myContext = context;

}

private SessionContext myContext;

/**

  • Create Method.

*/

public void ejbCreate() throws CreateException {

// TODO : Implement

}

/* (non-Javadoc)

  • @see com.sap.aii.af.mp.module.Module#process(com.sap.aii.af.mp.module.ModuleContext, com.sap.aii.af.mp.module.ModuleData)

*/

public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {

// TODO Auto-generated method stub

Object obj = null;

Message msg = null;

String fileName = null;

// String fileName = "default"; //Change in code as per SDN\

try {

obj = inputModuleData.getPrincipalData();

msg = (Message) obj;

Hashtable mp = (Hashtable)inputModuleData.getSupplementalData("module.parameters");

if (mp != null)

fileName = (String)mp.get("FileName");

//Change in code as per SDN

// else fileName = "default";

} catch (Exception e) {

ModuleException me = new ModuleException(e);

throw me;

}

try{

XMLPayload xmlpayload = msg.getDocument();

DocumentBuilderFactory factory;

factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();

Document document = builder.parse((InputStream)xmlpayload.getInputStream());

Element rootNode = document.getDocumentElement();

if(rootNode != null){

Element childElement = document.createElement("FileName");

childElement.appendChild(document.createTextNode(fileName));

rootNode.appendChild(childElement);

}

// Transforming the DOM object to Stream object.

TransformerFactory tfactory =

TransformerFactory.newInstance();

Transformer transformer =

tfactory.newTransformer();

Source src = new DOMSource(document);

ByteArrayOutputStream myBytes = new

ByteArrayOutputStream();

Result dest = new StreamResult(myBytes);

transformer.transform(src,dest);

byte[] docContent = myBytes.toByteArray();

if(docContent != null){

xmlpayload.setContent(docContent);

inputModuleData.setPrincipalData(msg);

}

} catch (Exception e) {

ModuleException me = new ModuleException(e);

throw me;

}

return inputModuleData;

}

}

Former Member
0 Kudos

Error which i get now

Error: null --> Only this error message i can see in the RWB cc Monitoring

Regards

Srini

Former Member
0 Kudos

Time Stamp Status Description

2008-06-02 17:08:27 Success Channel CC_DMS_FILE_SENDER_FINAL: Entire file content converted to XML format

2008-06-02 17:08:27 Success Channel CC_DMS_FILE_SENDER_FINAL: Send binary file "d:\mdmtest\srinivaS\test.txt". Size 151 with QoS EO

2008-06-02 17:08:27 Error Attempt to process file failed with null

2008-06-02 17:08:30 Success Channel CC_DMS_FILE_SENDER_FINAL: Entire file content converted to XML format

2008-06-02 17:08:30 Success Channel CC_DMS_FILE_SENDER_FINAL: Send binary file "d:\mdmtest\srinivaS\test.txt". Size 151 with QoS EO

2008-06-02 17:08:30 Error Attempt to process file failed with null

2008-06-02 17:08:40 Success Channel CC_DMS_FILE_SENDER_FINAL: Entire file content converted to XML format

2008-06-02 17:08:40 Success Channel CC_DMS_FILE_SENDER_FINAL: Send binary file "d:\mdmtest\srinivaS\test.txt". Size 151 with QoS EO

2008-06-02 17:08:40 Error Attempt to process file failed with null

2008-06-02 17:08:50 Success Channel CC_DMS_FILE_SENDER_FINAL: Entire file content converted to XML format

former_member187563
Contributor
0 Kudos

hi,

I have used one module called renaming attachment and i have not removed the library files and still its working fine for me.So its not mandatory to remove the library files.

And if you want to remove the library files then remove only

aii_adapter_xi_svc.jar

aii_af_cci.jar

aii_af_cpa.jar

aii_af_mp.jar

aii_af_ms_api.jar

aii_af_ms_spi.jar

aii_af_trace.jar

these files.

And try to deploy from visual admin instead of SDM.There you can see which classes are missing.

If you are not able to deploy again.Then dont remove the .jar files and deploy again.

If you are using a decentralized adapter engine,then try instead of using that try to deploy it on Integration server.

And let me know what error you are facing.

hope it helps.

regards,

ujjwal kumar

Former Member
0 Kudos

Hi Actually,

i deployed using NWDS , i have my .ear file and all othe developments on my local pc (workstation) how could i call those to my PI system which is entirely on other system, should i need to copy those .ear files to the PI system and deploy them

please explain

srini

former_member187563
Contributor
0 Kudos

hi,

Yes you have to copy the .ear file to your PI System and then you can deploy using visual admin or SDM.

But its ok to deploy from NWDS.

Did you remove the jar files which i said to remove,are you still getting the same error.

What exception are you getting when you deploy without removing the jar files.

regards.

Former Member
0 Kudos

hi still same error :

Error: java.lang.ClassCastException: class com.sap.srinifinal.VSriniFileLocalHomeImpl0_0 can not be casted to ModuleLocalHome or SModuleLocalHome

if i remove those .jar files it says in the visual admin that those class has to set in the path , not found.

What couls be the problem, i hope am beatinf around somewhere near , kindly help me out

thx in advance

srini

Former Member
0 Kudos

My Error Description after : clicking on the Message Id:

Attempt to process file failed with java.lang.ClassCastException: class com.sap.aii.af.mp.module.ModuleLocalHomeImpl0_0 can not be casted to ModuleLocalHome or SModuleLocalHome

Srini

former_member187563
Contributor
0 Kudos

hi,

i am also facing same problem in one of my modules.

you can try the following things:

1.Dont delete the jar files.

2.I think now you will be doing like:

<ModuleLocal>packagename.classname</ModuleLocal>

but try to use as below

In ejb-jar.xml file, modify Home,Remote,Local,LocalHome entries.

use these entries in respective tags:

com.sap.aii.af.mp.module.ModuleHome

com.sap.aii.af.mp.module.ModuleRemote

com.sap.aii.af.mp.module.ModuleLocalHome

com.sap.aii.af.mp.module.ModuleLocal

3.You need references to connector.jar file which has the classes required at compile time and runtime

Compile time :

From the context menu of the EJB project , follow the path Properties -> Java Build Path -> Libraries.

Click on Add variable and select TSSAP_JAVAX_HOME and click on Extend and select connector.jar from the list displayed.

Run time :

Navigate to the application-j2ee-engine.xml in your EAR project.

Select References on the General tab and click on Add.

Select Select library/interface/service as shown in the snapshot and select j2eeca as in the next snapshot.

4.RESTART YOUR SERVER AFTER DEPLOYMENT.

regards,

ujjwal kumar

Former Member
0 Kudos

Hi Ujwal,

I see no snapshots kindly provide the same thanks in advance

srini

Former Member
0 Kudos

Hi After doing all these ,

Now i get below error statement ; am driven by series of Errors

Error: org.xml.sax.SAXParseException: Character conversion error: "Unconvertible UTF-8 character beginning with 0x82" (line number may be too low).

Any views

Srini