Thursday, July 11, 2013

JAVA: The filename, directory name, or volume label syntax is incorrect

While doing file copy operation using java, if we come across an error saying

"The filename, directory name, or volume label syntax is incorrect"

then check the source filename which we are trying to copy and ensure there is no white space before or after the filename.

Better to use fileName.trim() before trying to copy

Wednesday, July 10, 2013

B2B : java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createSourceFromBLOBNative

If B2B transaction is failed , check the server logs, and if the below error is found, then it is an issue with loading the native library for XEEngine

java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createSourceFromBLOBNative(Ljava/lang/String;[BLjava/lang/String;)Lcom/edifecs/xengine/xeobjects/XESource;    

To solve this issue, do the following steps

1) set the library path in setSOADomainEnv.cmd as follows
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djava.library.path=<middlewarehome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin

2) copy the wlntio.dll from <middlewarehome>\wlserver_10.3\server\native\win\x64  to <middlewarehome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin

3) copy the wlntio.dll from <middlewarehome>\wlserver_10.3\server\native\win\x64  to <JAVAHOME>\bin

also ensure the following properties are set setSOADomainEnv.cmd
set XENGINE_DIR=" <middlewarehome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine"
set PATH=%PATH%; <middlewarehome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin

Restart both Admin and ManagedServer . Ensure you have run the script setSOADomainEnv.cmd before restarting the server

Tuesday, July 2, 2013

How to get the list of partitions of em using java - SOA 11g



The following java code will  get all the partitions available in em


public static ArrayList getPartitions(String host,String port,String username,String password) throws Exception
{
 System.out.println("Trying list all partitions in "+host);
  ArrayList partitions = new ArrayList();
    boolean found = false;

String contextFactory = "weblogic.jndi.WLInitialContextFactory";

String mbeanRuntime = "weblogic.management.mbeanservers.runtime";
String jmxProtoProviderPackages = "weblogic.management.remote";

String mBeanNamePartition = "oracle.soa.config:Application=soa-infra,j2eeType=FolderLifecycleConfig,name=soa-infra";
MBeanServerConnection mbsc = TestComposite.getMbeanServerConnection(host, port, username, password,mbeanRuntime,jmxProtoProviderPackages);


ObjectName mbeanpartition = new ObjectName(mBeanNamePartition);

Object FolderArray = mbsc.getAttribute(mbeanpartition, "Folders");
System.out.println("FolderArray ="+FolderArray);
Folder[] folderData = (Folder[]) FolderArray;
for (int i = 0; i < folderData.length; i++) {
System.out.println("Folder Data"+folderData[i].getName());
partitions.add(folderData[i].getName());
}


System.out.println("partitions size"+partitions.size());
return partitions;

}

Server is Running in Development Mode and Native Library(terminalio) to read the password se curely from commandline is not found

In case we encounter this type of error, in the setSOADomainEnv.cmd add an additional attribute (-Dweblogic.management.allowPasswordEcho=true) to the the JAVA_OPTIONS as shown below

set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.allowPasswordEcho=true


Now , open a new command prompt and run the setSOADomainEnv.cmd.

Then start the server from the command prompt.



In case of unix system,

edit the   setSOADomainEnv.sh  as shown below

export JAVA_OPTIONS="$JAVA_OPTIONS -Dweblogic.management.allowPasswordEcho=true"