Quantcast
Channel: SCN: Message List - SAP Business One Integration Technology
Viewing all articles
Browse latest Browse all 973

Problems with a Java Class Call

$
0
0

Hi everyone!

 

I'm trying to call a Java Class since B1if but I have some problems with that. When I run my scenario step I get the next error BPE027 Could not get an instance for 'Callable'-class Further details: className:... I don't know what I'm doing wrong, I'm putting the .jar in the B1iXcellerator\WEB-INF\lib path, after do this I restarted the services. My class is this: 

 

package com.sap.utilidades.clases;

 

 

import com.sap.b1i.bizprocessor.*;

import java.io.File;

import java.sql.*;

import java.util.*;

 

 

public class SYS_CL_BuscaCarpetas implements Callable{

    public SYS_CL_BuscaCarpetas(){

    }

 

 

    @Override

    public boolean isThreadSafe() { return false; }

    @Override

  public boolean usesJDBC() { return false; }

    @Override

  public void mustDestroy() { }

 

 

    @Override

  public boolean call(Properties inProps, BizProcMessage inMsg, Properties outProps, BizProcMessage outMsg, Connection iConn, String jobID) throws Exception

  {

  String sRuta = inProps.getProperty("sRuta");

       String sFileName = inProps.getProperty("sNombre") + ".xml";

       

        if (sRuta.length() != 0 || sFileName.length() != 0) {

            String sRutaOK = FindDocument(sFileName, sRuta);

            byte data[] = (sRutaOK).getBytes("UTF-8");

            outMsg.setXMLMSGPayload(data);

        } else

            throw new Exception("No se Encontró Cadena de Entrada (Ruta)");

 

 

  return true;

  }

       

         public String FindDocument(String FileName, String Ruta){

       File f = new File(Ruta);

        if (f.exists()) {

            File[] ficheros = f.listFiles();

            for (File fichero : ficheros) {

                if (fichero.isDirectory()) {

                    String Separador = System.getProperty("file.separator");

                    // listarDirectorio(ficheros[x], Separador, FileName);

                    if (!"".equals(listarDirectorio(fichero, Separador, FileName))) {

                        return listarDirectorio(fichero, Separador, FileName);

                    }

                } else if (fichero.getName().equals(FileName)) {

                    return f.getPath();

                }

            }

        }

        else{

        return "No se encontró el directorio";

        }

       

        return "No se encontró el directorio";

    }

   

    public String listarDirectorio(File Directorio, String Separador, String FileName){

          File[] NFicheros = Directorio.listFiles();

        for (File NFichero : NFicheros) {

            if (NFichero.isDirectory()) {

                Separador = System.getProperty("file.separator");

                if (!"".equals(listarDirectorio(NFichero, Separador, FileName))) {

                     return NFichero.getPath();

                }

            } else if (NFichero.getName().equals(FileName)) {

                return NFichero.getPath();

            }

        }

        return "";

    }

   

}

 

I don´t know what is the problem, Could any help me with this???


I hope someone can help me...


thanks in advanced


Viewing all articles
Browse latest Browse all 973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>