Skip to Content

Erro module B2B inbound NW 7.4

Prezados,

estou com o seguinte problema no deploy do module B2B inbound.

Gerei o EAR e no momento que o basis realiza o deploy é gerado o seguinte log de erro:

#2.0 #2014 05 22 15:09:29:991#0-300#Error#com.sap.engine.deployment.operations.StartOperation#

###C0000AAF0C9700030000000556554ACB###com.sap.engine.deployment.operations.StartOperation#####319a967393f613709f8fd36e62d7a10b###Thread[Thread-17,5,main]#Plain##

Could not start [sap.com/CustomAdapterModule @ Server 00 51_5182458 - 518245850]

[EXCEPTION]

com.sap.engine.deployment.exceptions.SAPRemoteException: [ERROR CODE DPL.JSR.8041] Could not start application sap.com/CustomAdapterModule

at com.sap.engine.deployment.proxy.DeploymentProxyImpl.start(DeploymentProxyImpl.java:496)

at com.sap.engine.deployment.operations.StartOperation.run(StartOperation.java:54)

at java.lang.Thread.run(Thread.java:761)

Error occurred on server 518245850 during startApp of sap.com/CustomAdapterModule : com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Application sap.com/CustomAdapterModule cannot be started. Reason: it has hard reference to library:com.sap.aii.messaging.runtime, which is not active on the server because library is not deployed on server. Probably application sap.com/CustomAdapterModule declares runtime but no deploytime dependency to the library which is wrong. Deploy the missing library com.sap.aii.messaging.runtime as a workaround or contact application owners to check their references..

at com.sap.engine.services.deploy.server.LifecycleController.assureLibraryIsResolved(LifecycleController.java:536)

at com.sap.engine.services.deploy.server.LifecycleController.startReferencedComponent(LifecycleController.java:211)

at com.sap.engine.services.deploy.server.LifecycleController.startReferencedComponents(LifecycleController.java:179)

at com.sap.engine.services.deploy.server.application.StartTransaction.beginCommon(StartTransaction.java:206)

at com.sap.engine.services.deploy.server.application.StartTransaction.begin(StartTransaction.java:171)

at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:421)

at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:473)

at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesSequentially(ParallelAdapter.java:324)

at com.sap.engine.services.deploy.server.application.StartTransaction.makeAllPhases(StartTransaction.java:645)

at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:1832)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:2482)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationOnInstanceWait(DeployServiceImpl.java:2734)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationOnInstanceAndWaitAuth(DeployServiceImpl.java:2883)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:2435)

at com.sap.engine.services.dc.lcm.impl.J2EELCMProcessor.doStart(J2EELCMProcessor.java:109)

at com.sap.engine.services.dc.lcm.impl.LifeCycleManagerImpl.start(LifeCycleManagerImpl.java:80)

at com.sap.engine.services.dc.lcm.impl.RemoteLCMImpl.start(RemoteLCMImpl.java:47)

at com.sap.engine.services.dc.lcm.impl.RemoteLCMImplp4_Skel.dispatch(RemoteLCMImplp4_Skel.java:252)

at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:466)

at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69)

at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:72)

at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:43)

at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:999)

at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:59)

at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55)

at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)

at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)

at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)

Eu acredito que seja a falta do registro da Lib dentro do servidor NW, porém o basis me informou que o mesmo foi feito, porém o erro continua.

Não é apresentado erro no código fonte.

Segue a estrutura do código no SNDS

Alguem pode me ajudar?

Obrigada.

NDS.JPG (60.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on May 22, 2014 at 08:30 PM

    Oi Débora,

    Esse Module Adapter era utilizado no NW 7.0?

    No seu print aparece o uso do JSDK 1.4.2, para o NW 7.4 é necessário utilizar o JSDK 1.6, além das bibliotecas do SAP referentes ao NW 7.4.

    Att.,

    Baroni

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 03, 2014 at 02:26 PM

    Prezados,

    consegui resolver o erro gerado no canal pelo Module. Meu erro agora está no GRC. Vou abrir outra thread para esse novo erro.

    Agradeço a todos pela ajuda!!!!

    Segue as libs utilizadas:

    com.sap.aii.af.cpa.svc.api

    com.sap.aii.af.ms.ifc_api

    com.sap.aii.af.svc_api

    com.sap.aii.af.lib.mod

    Código Fonte do module:

    package com.sap.pi.com;

    import java.io.BufferedReader;

    import java.io.BufferedWriter;

    import java.io.File;

    import java.io.FileWriter;

    import java.io.IOException;

    import java.io.InputStream;

    import java.io.InputStreamReader;

    import java.io.Reader;

    import java.io.StringWriter;

    import java.io.Writer;

    import java.util.Iterator;

    import java.util.Random;

    import javax.ejb.CreateException;

    import javax.ejb.SessionBean;

    import javax.ejb.SessionContext;

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

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

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

    import com.sap.aii.af.service.auditlog.Audit;

    import com.sap.engine.interfaces.messaging.api.Message;

    import com.sap.engine.interfaces.messaging.api.MessageKey;

    import com.sap.engine.interfaces.messaging.api.Payload;

    import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;

    /**

    * @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>

    * @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>

    * @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>

    * @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>

    * @stateless

    */

    public class ReadMultipleAttachment implements SessionBean, Module {

    private SessionContext myContext;

    public void ejbRemove() {

    }

    public void ejbActivate() {

    }

    public void ejbPassivate() {

    }

    public void setSessionContext(SessionContext context) {

    myContext = context;

    }

    public void ejbCreate() throws CreateException {

    }

    // Method descriptor #12 (Lcom/sap/aii/af/mp/module/ModuleContext;Lcom/sap/aii/af/mp/module/ModuleData;)Lcom/sap/aii/af/mp/module/ModuleData;

    //public abstract com.sap.aii.af.mp.module.ModuleData process(com.sap.aii.af.mp.module.ModuleContext arg0, com.sap.aii.af.mp.module.ModuleData arg1) throws com.sap.aii.af.mp.module.ModuleException;

    //com.sap.engine.services.ejb3.container.ActionException: Cannot find business method 'process' with args [interface com.sap.aii.af.lib.mp.module.ModuleContext, class com.sap.aii.af.lib.mp.module.ModuleData] in class com.sap.pi.com.ReadMultipleAttachment for component sap.com/FileModule_EJBEAR*xml|FileModule_EJB.jar*xml|ReadMultipleAttachment

    public ModuleData process(ModuleContext moduleContext,

    ModuleData inputModuleData) {

    Message mailMessage = (Message) inputModuleData.getPrincipalData();

    //amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());

    MessageKey amk = new MessageKey(mailMessage.getMessageId(), mailMessage.getMessageDirection());

    String attachmentText;

    String filePath;

    Payload attachmentPayload;

    // Acessar a lista de anexos

    Iterator attachmentIterator = mailMessage.getAttachmentIterator();

    try {

    while (attachmentIterator.hasNext()) {

    // Carregar o anexo do email

    attachmentPayload = (Payload) attachmentIterator.next();

    if (attachmentPayload.getContentType().indexOf(".xml") > 0) {

    // Carregar o conteúdo do anexo xml em formato string

    attachmentText = convertStreamToString(attachmentPayload

    .getInputStream());

    // Montar um nome para o arquivo que será gravado

    filePath = getFilePath(attachmentPayload.getContentType(),

    attachmentText);

    if (filePath.indexOf("discard") < 0) {

    // Gravar o arquivo válido no filesystem

    BufferedWriter bwriter = new BufferedWriter(

    new FileWriter(new File(filePath)));

    bwriter.write(attachmentText);

    bwriter.close();

    } else {

    Audit.addAuditLogEntry(amk, AuditLogStatus.WARNING,

    "O arquivo: "

    + attachmentPayload.getContentType()

    + " da mensagem "

    + mailMessage.getMessageId()

    + " não tem as tags de NFe.");

    }

    } else {

    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,

    "O arquivo: " + attachmentPayload.getContentType()

    + " da mensagem "

    + mailMessage.getMessageId()

    + " foi descartado por não ser xml.");

    }

    }

    } catch (RuntimeException runtimeException) {

    runtimeException.printStackTrace();

    Audit.addAuditLogEntry(amk, AuditLogStatus.WARNING,

    "Ocorreu uma runtime exception processando a mensagem "

    + mailMessage.getMessageId() + ": "

    + runtimeException.getMessage());

    } catch (Exception generalException) {

    generalException.printStackTrace();

    Audit.addAuditLogEntry(amk, AuditLogStatus.WARNING,

    "Ocorreu uma general exception processando a mensagem "

    + mailMessage.getMessageId() + ": "

    + generalException.getMessage());

    }

    return inputModuleData;

    }

    private String convertStreamToString(InputStream inputStream)

    throws IOException {

    if (inputStream != null) {

    Writer writer = new StringWriter();

    char[] buffer = new char[1024];

    try {

    Reader reader = new BufferedReader(new InputStreamReader(

    inputStream, "UTF-8"));

    int n;

    while ((n = reader.read(buffer)) != -1) {

    writer.write(buffer, 0, n);

    }

    } finally {

    inputStream.close();

    }

    return writer.toString();

    } else {

    return "";

    }

    }

    private String getFilePath(String contentType, String attachmentText) {

    String filePath = "";

    String fileName;

    File file;

    // Ler o atributo name e desconsiderar a extensão (que já é conhecida,

    // xml)

    fileName = contentType.substring(contentType.indexOf("name=") + 6,

    contentType.length() - 1).toLowerCase();

    // Identificar se o arquivo é de cancelamento ou de entrada pela tag

    // raiz (mesma estratégia do standard)

    if(attachmentText.indexOf("<nfeProc") > 0){

    filePath = "/interfaces/inbox/NFe/";

    } else

    if(attachmentText.indexOf("<cteProc") > 0){

    filePath = "/tmp/notas_grd/";

    } else

    if (attachmentText.indexOf("<procCancNFe") > 0) {

    filePath = "/tmp/notas_grd/cancel/";

    }else{

    filePath = "/tmp/notas_grd/discard/";

    }

    // Verificar se o arquivo existe, e adicionar um random no nome do

    // arquivo caso já exista

    file = new File(filePath + fileName);

    if (file.exists() == true) {

    Random r = new Random();

    return filePath + Long.toString(r.nextLong()) + fileName;

    }

    return filePath + fileName;

    }

    }

    Configuração canal de mail:


    Conf_module.JPG (85.8 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.