Powered By Blogger

Monday, February 18, 2013

Changing Jdev SVN repository credentials when username/password changed

Jdeveloper caches SVN repository credentials when versioning application(SVN) is configured
There is no easy way to update user name/password when credentials are changed
You might think you can create new connection with changed credentials but Jdev doesn't allow you to create one more connection with same repository url

The only way I can feel is clearing Jdev cache.

Follow below steps to clear Jdev cache.

  • Stop Jdeveloper
  • Locate your cached svn credential in the C:\Users\<username>\AppData\Roaming\JDeveloper\system11.1.1.6.38.61.92\o.jdeveloper.subversion\repository.xml
  • Rename the repository.xml
  • Recreate your connection to the repository in Jdeveloper
  • The repository.xml is recreated with correct credentials
  • Start the jdeveloper
Another option is we can directly go to above said path,open repository.xml  and put changed credentials details over there and start the jdev, but problem with this option is plain text password is stored which is not a good practise.
If you wanted to verify certain SVN parameters then please go to

Tools -> Preferences -> Versioning -> General -> Edit "server"

Saturday, February 2, 2013

schemaLocation vs xsi:schemaLocation attributes usage

In this post let's talk about schemaLocation and xsi:schemaLocation attributes usage and their significance which are being used by XML schema.
Remember that both attributes are having same name but coming from different namespace so they are used for different purpose
There are three circumstances for using this attributes

Scenario1:(xsi:schemaLocation ) in an XML instance document

This attribute is hint to XML processor from the document author regarding the access location of schema documents.These schema documents are used to checking the validity of the document content, on a namespace by namespace basis. For example, we can indicate the location of the Order schema to a processor of the Order XML document 

In the below example processor [may] contact given location to download the schema and use it
xmlns=http://www.oracle.com/Order
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation="http://www.oracle.com/Order
http://www.oracle.com/Order.xsd">


schemaLocation attribute value contains of one or more pairs of URI references, separated by white space. The first part of each pair is a namespace name, and the second part of the pair is a an URI describing where to find an appropriate schema document for that namespace. The presence of these hints does not mean that the processor has to obtain or use the cited schema documents, and the processor is free to use other schemas obtained by any suitable means like loading from classpath jars, or to use no schema at all.

There is an interesting error I have seen when URI in this attribute is not reachable

Error

[name of xml file being processed] is invalid; nested exception is oracle.xml.parser.schema.XSDException: Network is unreachable
at

at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:425)at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:376)

at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:226)at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:155)at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)

... 71 more

Caused by: oracle.xml.parser.schema.XSDException: Network is unreachable
at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:652)
at oracle.xml.parser.schema.XSDValidator.processSchemaLocation(XSDValidator.java:1003)

at oracle.xml.parser.schema.XSDValidator.startElement(XSDValidator.java:604)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1524)

at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:409)

at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:355)

... 75 more

:oracle.xml.parser.schema.XSDException:Network is unreachable

at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:652)

at oracle.xml.parser.schema.XSDValidator.processSchemaLocation(XSDValidator.java:1003)

at oracle.xml.parser.schema.XSDValidator.startElement(XSDValidator.java:604)

at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1524)

at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:409)

at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:355)

at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:226)

at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:155)

at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)


Solution for this issue is to remove xsi:schemaLocation from xml instance before processor starts processing it.

Scenario2:(schemaLocation in include) in  xsd


In a schema, the include  element has a required schemaLocation attribute, and it contains a URI reference which must resolve to accessible schema document. The effect is to compose a final effective schema by merging the declarations and definitions of the including and the included schemas.
Unlike xsi:schemaLocation this is not a hint  but it is directive to processor and failure to connect to given URI causes error

Scenario3:(schemaLocation in import ) in  xsd

import element  in schema also uses an optional namespace and schemaLocation attributes.

The difference between include and import is, include is used to load the xml elements/type definitions from same target namespace as including document
import is used to load xml elements/types from different namespace than importing document


Friday, February 1, 2013

BPEL With SFTP Error in establishing a session with SSH Server


BPEL FTP adapter can be configured with SSH protocol  using  two ways
  • username/password authentication 
  • public key based authentication
When you see below errors in the log, then there is a reason for it

oracle.tip.adapter.ftp.SshImpl.SSHSessionImpl.setUpPasswordSocketConnection
The SSH API threw an exception.
"BINDING.JCA-11447"
Error in establishing a session with SSH Server..

Why this error?

There are two reasons I am aware of 
  1. When Daemon that accepts connections on FTP server is not running.If you identify this is the issue then start the daemon then shutdown and start polling composite otherwise files will not be polled even after daemon is started.I believe registered JCA endpoint is getting deactivated after few attempts.
  2. When we change FTP adapter deployment  JNDI properties such as host name,port, authentication type etc..then we will update adapter deployment expecting everything will be all right
For all polling integrations SOA engine will register and activate polling listener during server start up or process deployment or process activate/deactivate and shutdown /start up

After updating adapter deployment,we have adapter instance with modified  values but agent listener is activated with old values.

Solution

It is very simple activate/reactivate the process which will re register the agent listener with modified values
We will see below error when we run the process without restarting

SOA Error Log  
setting up session>
&lt;Jan 30, 2013 2:19:12 AM PST> &lt;Error> &lt;oracle.soa.adapter> &lt;BEA-000000> &lt;FTP Adapter ProcessName
BINDING.JCA-11445
The SSH API threw an exception.
The SSH API threw an exception.
The SSH API threw an exception.
Maverick has not been setup properly. Please correct the setup.

        at oracle.tip.adapter.ftp.SshImpl.SSHSessionImpl.setUpPasswordSocketConnection(SSHSessionImpl.java:206)
        at oracle.tip.adapter.ftp.SshImpl.SSHSessionImpl.&lt;init>(SSHSessionImpl.java:128)
        at oracle.tip.adapter.ftp.SshImpl.SshImplFactory.getSshImpl(SshImplFactory.java:26)
        at oracle.tip.adapter.ftp.SFTPManagedConnection.setupSftpConnection(SFTPManagedConnection.java:154)
        at oracle.tip.adapter.ftp.SFTPManagedConnection.&lt;init>(SFTPManagedConnection.java:66)
        at oracle.tip.adapter.ftp.FTPManagedConnectionFactory.createManagedConnection(FTPManagedConnectionFactory.java:180)
        at weblogic.connector.security.layer.AdapterLayer.createManagedConnection(AdapterLayer.java:803)
        at weblogic.connector.outbound.ConnectionFactory.createResource(ConnectionFactory.java:91)
        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1310)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:419)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:343)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:323)
        at weblogic.connector.outbound.ConnectionPool.reserveResource(ConnectionPool.java:620)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:317)
        at weblogic.connector.outbound.ConnectionManagerImpl.getConnectionInfo(ConnectionManagerImpl.java:380)
        at weblogic.connector.outbound.ConnectionManagerImpl.getConnection(ConnectionManagerImpl.java:320)
        at weblogic.connector.outbound.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:129)
        at oracle.tip.adapter.ftp.FTPConnectionFactory.getConnection(FTPConnectionFactory.java:102)
        at oracle.tip.adapter.ftp.SFTPAgent.preCall(SFTPAgent.java:1192)
        at oracle.tip.adapter.ftp.SFTPAgent.validateInputDir(SFTPAgent.java:758)
        at oracle.tip.adapter.ftp.inbound.FTPSource.validateInputDir(FTPSource.java:1189)
        at oracle.tip.adapter.ftp.inbound.FTPSource.revalidatePollingError(FTPSource.java:1357)
        at oracle.tip.adapter.file.inbound.PollWork.onAlert(PollWork.java:475)
        at oracle.tip.adapter.file.inbound.PollWork.run(PollWork.java:357)
        at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
        at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
        at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
Caused by: com.maverick.ssh.SshException: Read timed out
        at com.maverick.ssh.SshConnector.A(Unknown Source)
        at com.maverick.ssh.SshConnector.connect(Unknown Source)
        at oracle.tip.adapter.ftp.SshImpl.SSHSessionImpl.setUpPasswordSocketConnection(SSHSessionImpl.java:194)
        ... 26 more
>
&lt;Jan 30, 2013 2:19:12 AM PST> &lt;Warning> &lt;Connector> &lt;BEA-190032> &lt;&lt; eis/Ftp/FTPAdapter > ResourceAllocationException thrown by

resource adapter on call to ManagedConnectionFactory.createManagedConnection(): "BINDING.JCA-11447
Error in establishing a session with SSH Server..
Error in establishing a session with SSH Server..
Unable to establish a session with the server.
Please ensure hostname and port specified to login to the server are correct.