Hi Jerry,
I have added dbadapter.jar and nice-2003-04-24.jar which contains the “RunAdaptor.class” and “LogWriter.class” in C:\Program Files\webMethods6\IntegrationServer\packages\DBADAPTER\code\jars folder.I have given the testing.java file below:
// -----( IS Java Code Template v1.2
// -----( CREATED: 2008-08-20 18:34:07 IST
// -----( ON-HOST: blrkec36422d.ad.infosys.com
import com.wm.data.;
import com.wm.util.Values;
import com.wm.app.b2b.server.Service;
import com.wm.app.b2b.server.ServiceException;
// — <> —
import java.io.;
import java.text.;
import java.util.;
import java.lang.*;
// — <> —
public final class testing
{
// —( internal utility methods )—
final static testing _instance = new testing();
static testing _newInstance() { return new testing(); }
static testing _cast(Object o) { return (testing)o; }
// —( server methods )—
public static final void getHomeDir (IData pipeline)
throws ServiceException
{
// — <<IS-START(getHomeDir)>> —
// @subtype unknown
// @sigtype java 3.5
// [i] field:0:required homeDir
String homeDir = System.getProperty(“user.home”);
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, “homeDir”, homeDir );
pipelineCursor_1.destroy();
// — <> —
}
public static final void loadProperties (IData pipeline)
throws ServiceException
{
// — <<IS-START(loadProperties)>> —
// @subtype unknown
// @sigtype java 3.5
// [i] field:0:required strNewFileName
// [i] field:0:required propsFileName
// [i] field:0:required prvKeyPath
// [i] field:0:required batchFileLocation
// [o] field:0:required propertyObj
IDataCursor pipelineCursor_1 = pipeline.getCursor();
String strNewFileName = IDataUtil.getString( pipelineCursor_1, “newFileName” );
String propsFileName = IDataUtil.getString( pipelineCursor_1, “propsFileName” );
// String prvKeyPath = IDataUtil.getString( pipelineCursor_1, “prvKeyPath” );
String batchFileLocation = IDataUtil.getString( pipelineCursor_1, “batchFileLocation” );
pipelineCursor_1.destroy();
/*
Retrieves values from configuration file named "MOSCOWdbInternet_Dev.props" from
directory [server]/packages/DbPrismaPUDomainDBIntIBusMOSCOW/config
*/
// build the location of the config file
String configFile = "packages" + File.separator + "DBADAPTER" + File.separator +
"config" + File.separator + propsFileName;
try
{
// read in the file stream and convert it to a properties object
FileInputStream configFileInputStream = new FileInputStream( configFile );
// properties object is already defined in the Shared code
properties = new Properties();
properties.load( configFileInputStream );
properties.setProperty("adaptor.C1.BatchFileSet.Patterns1",strNewFileName);
// properties.setProperty(“adaptor.C6.PublicKeyAuthentication.PrivateKey.FileName”,prvKeyPath);
properties.setProperty(“adaptor.C1.BatchFileSet.Location”,batchFileLocation);
boolean propertiesLoaded = true;
}
catch ( FileNotFoundException e )
{
// print error to standard out and throw an error
throw new ServiceException ("Error finding property file: "+e.getMessage());
}
catch ( IOException e )
{
//print error to standard out and throw an error
throw new ServiceException ("Error reading yourCustomConfig.cnf property file: "+e.getMessage());
}
IDataCursor pipelineCursor = pipeline.getCursor();
IDataUtil.put(pipelineCursor, “propertyObj”, properties);
pipelineCursor.destroy();
// — <> —
}
public static final void runAdaptor (IData pipeline)
throws ServiceException
{
// — <<IS-START(runAdaptor)>> —
// @subtype unknown
// @sigtype java 3.5
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String adaptorName = IDataUtil.getString( pipelineCursor, “adaptorName” );
Properties propertyObj = (Properties) IDataUtil.get( pipelineCursor, “propertyObj” );
pipelineCursor.destroy();
String successFlag = "TRUE";
System.out.println("About to invoke adapter");
writeLog("About to invoke adapter");
try{
System.out.println("props = " + propertyObj);
RunAdaptor adaptor = new RunAdaptor(adaptorName, propertyObj);
// ShutdownRunAdaptor adaptor = new ShutdownRunAdaptor(adaptorName, propertyObj);
System.out.println("Instance created");
//writeLog("Instance created ");
adaptor.run();
System.out.println("Adapter running... About to terminate");
//writeLog("Adapter running... About to terminate");
adaptor.getController().terminate();
System.out.println("Adapter terminated");
//writeLog("Adapter terminated");
}catch (Exception e){
successFlag = "FALSE";
e.printStackTrace();
//writeLog("In 1st Catch Block");
throw new ServiceException("IbafException " + e.getMessage());
}catch (ClassCastException cce){
successFlag = "FALSE";
cce.printStackTrace();
//writeLog("In 2nd Catch Block");
throw new ServiceException(" ERROR IN CREATING THE LOCALSOURCE;CHECK COMPONENT NAME AND LOGGING " + cce.getMessage());
}catch(Exception e){
successFlag = "FALSE";
e.printStackTrace();
//writeLog("In 3rd Catch Block");
throw new ServiceException(" ERROR IN SETUP OF THE IBUSADAPTOR " + e.getMessage());
}
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, “successFlag”, successFlag );
pipelineCursor_1.destroy();
// — <> —
}
// — <> —
public static Properties properties=null;
// — <> —
}
But still I’m getting the error
C:\Program Files\webMethods6\IntegrationServer\packages\DBADAPTER\code\source\testing.java:132: cannot find symbol
symbol : method writeLog(java.lang.String)
location: class testing
writeLog(“About to invoke adapter”);
^
C:\Program Files\webMethods6\IntegrationServer\packages\DBADAPTER\code\source\testing.java:137: cannot find symbol
symbol : class RunAdaptor
location: class testing
RunAdaptor adaptor = new RunAdaptor(adaptorName, propertyObj);
^
C:\Program Files\webMethods6\IntegrationServer\packages\DBADAPTER\code\source\testing.java:137: cannot find symbol
symbol : class RunAdaptor
location: class testing
RunAdaptor adaptor = new RunAdaptor(adaptorName, propertyObj);
^
3 errors
Please check it.
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods