Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Monday, 13 November 2017

SOA 12c DBAdapter : JDeveloper Error Element 'properties' used but not declared

If you are trying to open your DBAdapter configuration but getting the below error in popup:

java.util.InvalidPropertiesFormatException:
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 12; <Line 2, Column 12>:
XML-20149: (Error) Element 'properties' used but not declared.
    at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:80)
    at java.util.Properties$XmlSupport.load(Properties.java:1201)

The configuration still opens if you ignore the error but properties don't load correctly.

The reason for this error is that the properties declaration is missing from the adapter-properties.xml file.

Add the below line before the properties element in your adapter-properties.xml file.

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

Save and retry.

Helpful? Please Comment.

Happy Learning!!

Monday, 30 October 2017

ANT : How to get User, OS name and Environment properties

Here is what you need to do if you want to fetch below in/using ANT:

a. Logged user - built-in property
b. Machine OS name - built-in property
c. Environment properties - ANT provides a property task which has an attribute environment. Thus if you specify the task with environment="myenv" you will be able to access OS-specific environment variables via property names "myenv.PATH" or "myenv.TERM".


Below is a sample ant script.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="systeminfo">
  <target name="systeminfo">
    <property environment="my_env" />
    <echo>
      User is ${user.name}
      OS Name is ${os.name}     
      ANT_HOME is set to ${my_env.ANT_HOME}
    </echo>
  </target>
</project>
Output:

BuildFile: build.xml systeminfo
[echo]
[echo] User is nadimwarsi
[echo] OS Name is Windows 10 Enterprise
[echo] ANT_HOME is set to C:\Program Files\Java\jdk1.7
[echo] BUILD SUCCESSFUL
Total time: 0 seconds

Helpful? Please Comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...