cancel
Showing results for 
Search instead for 
Did you mean: 

XI 3.0StringBuffer Error java - mapping

Former Member
0 Kudos

Hi @ll;

I try to implement a java mapping in SAP Xi 3.0;

by trying to use the "append-method of the StringBuffer class.

But the following error arises:

<b>java.lang.NoSuchMethodError; java.lang.StringBuffer: method append(C)Ljava/lang/Appendable; not found.</b>

Can anybody help me?

thanks

Jochen

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I had same problem - StringBuffer seems to be not working under XI.

Finally I've found that I had wrong JRE at my specific project libraries. I've changed it from 1.6 to 1.4 and rebulid the source.

After uploading it to XI everytihng worked fine.

So, anyone - please check Your libriaries - that's the problem.

Best Regards,

Mikolaj

Former Member
0 Kudos

Hi Jochen,

I am using string buffer in advance user defined java function as follows and the append function works fine.

===============================================

String NTTEXT = "";

StringBuffer tmpStr = new StringBuffer();

for(int i=0;i<a.length;i++)

{

tmpStr.append(a<i>);

}

result.addValue(tmpStr.toString());

================================================

Post your code sample of the appending part. Lets have a look.

thanks,

Sasi

cdumont69
Contributor
0 Kudos

Hello,

Does it work in your JDE (Eclipse) ?

Regards,

Chris

Former Member
0 Kudos

Yes, it works in Eclipse!

thanks

Jochen

cdumont69
Contributor
0 Kudos

I just compare JDK 1.3 and 1.4 and perhaps the method you want to use only exist in 1.4 no in 1.3.

You must change your JDK to 1.3 to developp XI mapping.

Regards,

Chris

Former Member
0 Kudos

We used this method (append) also in Xi 2.0 and it works without any Problems.

so the method exists in JDK 1.3 and also in higher versions.

thanks

Jochen

Former Member
0 Kudos

Hi @ll;

the code:

-


StringBuffer xmlFile = new StringBuffer();

int c = in.read();

while (c != -1) {

xmlFile.append((char) c);

c = in.read();

}

-


thanks

Jochen

cdumont69
Contributor
0 Kudos

Perhaps you have already tested it, but try to you an other method with an other parameter (try without using cast)

<u>For example :</u>

xmlFile.append(c);

<b>or</b>

xmlFile.append(Integer.toString(c));

Regards,

Chris

Message was edited by: Christophe DUMONT

Former Member
0 Kudos

Hi @ll;

I edited the code.

I try to append just the string "Hello World" to the StringBuffer!

-


import java.io.DataOutputStream;

import java.io.InputStream;

import java.io.OutputStream;

import java.util.Map;

import com.sap.aii.mapping.api.StreamTransformation;

import com.sap.aii.mapping.api.StreamTransformationException;

public class TestMapping implements StreamTransformation {

String delemiter = new String(";");

/**

  • @see com.sap.aii.mapping.api.StreamTransformation#setParameter(Map)

*/

public void setParameter(Map arg0) {

}

public void execute(InputStream in, OutputStream out) throws StreamTransformationException {

try {

StringBuffer resultXML = new StringBuffer();

resultXML.append("HelloWorld");

DataOutputStream writeOut = new DataOutputStream(out);

writeOut.writeBytes(resultXML.toString());

} catch (Exception e) {

e.printStackTrace();

throw new StreamTransformationException("Exception during KeyMapping: (" + e.getClass().getName() + ") " + e.getMessage(), e);

}

}

}

-


Finally the same error arises!

thanks

Jochen

cdumont69
Contributor
0 Kudos

I just test your java mapping and it works for me.

I have XI 3.0 SP11.

What XI verson you use ?

Regards,

Chris

Former Member
0 Kudos

Hy,

I am a colleague of Jochen...

we also have the XI3.0 SP11.

It doesent works at our developement and qualtity XI.

Maybe we have an installation problem (we are running the XI on ZSeries and DB2).

I think we will open an OSS for this problem.

Thank you for your help,

Thomas

cdumont69
Contributor
0 Kudos

We have an RHEL ES3 with SAP DB and jdk 1.3.1.

Good luck

Regards,

Chris

Former Member
0 Kudos

@ll

thanks for your help

Regards,

Jochen

Former Member
0 Kudos

Hello!

I am having a very similar problem with StringBuffer in SAP WEB AS 6.40

Can somebody throw some light?

Details: java.lang.NoSuchMethodError: java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;

at com.test.framework.properties.PropertyManagerImpl.getProperties(PropertyManagerImpl.java:162)

at com.test.app.util.PropertiesHelper.getProperty(Unknown Source)

at jsp_login1120135922615._jspService(jsp_login1120135922615.java:26)

at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:467)

at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:181)

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

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

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

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

Former Member
0 Kudos

Hey,

Even I am getting similar error in WebAs while using JAXB and HTTP sender in EJB Web Services.

Did u get any solution for that??

com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method test.

at com.ltitl.ejb.pvtosap.PV_to_SAP_WebServiceObjectImpl10.test(PV_to_SAP_WebServiceObjectImpl10.java:269)

at com.ltitl.ejb.pvtosap.PV_to_SAP_WebService_Stub.test(PV_to_SAP_WebService_Stub.java:233)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)

at $Proxy316.test(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)

at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:146)

at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:68)

at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)

at SoapServlet.doPost(SoapServlet.java:51)

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

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

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

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

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

Caused by: java.lang.NoSuchMethodError: java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;

at com.ltitl.jaxb.impl.runtime.SAXMarshaller.text(SAXMarshaller.java:278)

at com.ltitl.jaxb.impl.INSPWDTYProjectImpl.serializeBody(INSPWDTYProjectImpl.java:239)

at com.ltitl.jaxb.impl.runtime.SAXMarshaller.childAsBody(SAXMarshaller.java:391)

at com.ltitl.jaxb.impl.INSPWDTYObjDetailsImpl.serializeBody(INSPWDTYObjDetailsImpl.java:64)

at com.ltitl.jaxb.impl.runtime.SAXMarshaller.childAsBody(SAXMarshaller.java:391)

at com.ltitl.jaxb.impl.runtime.MarshallerImpl.write(MarshallerImpl.java:171)

at com.ltitl.jaxb.impl.runtime.MarshallerImpl.marshal(MarshallerImpl.java:144)

at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:66)

at com.ltitl.ejb.pvtosap.PV_to_SAP_WebServiceBean.sendDataToXI(PV_to_SAP_WebServiceBean.java:1397)

at com.ltitl.ejb.pvtosap.PV_to_SAP_WebServiceBean.test(PV_to_SAP_WebServiceBean.java:367)

at com.ltitl.ejb.pvtosap.PV_to_SAP_WebServiceObjectImpl10.test(PV_to_SAP_WebServiceObjectImpl10.java:253)

... 32 more

; nested exception is:

java.lang.NoSuchMethodError: java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;