Showing posts with label JCA. Show all posts
Showing posts with label JCA. Show all posts

Tuesday, June 19, 2012

Enabling diagnostic log for FileAdapter (in general for oracle.soa.adapter)

The official doc here:

http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/life_cycle.htm#BABBIBEE

open em: http://myadmin.acme.com:7001/em
and identify the FileAdapter for each MS:



right click, Logs, Log configuration:





select "loggers with persistent log state level" (NOT Runtime Loggers)




search oracle.soa.adapter, and set to TRACE:32 FINEST, scroll down and enable the "persist" checkbox, click on Apply




do it for all MS in the cluster


the logs should go to
${MW_HOME}/user_projects/domains/${DOMAIN_NAME}/servers/${SERVER_NAME}/logs/${SERVER_NAME}-diagnostic.log

Sunday, June 3, 2012

java.lang.NoClassDefFoundError: oracle/integration/platform/kernel/FabricMeshUtils

We often get this error while using OSB with JCA File Adapter:

java.lang.NoClassDefFoundError: oracle/integration/platform/kernel/FabricMeshUtils
        at oracle.tip.adapter.file.inbound.FileListDAO.(FileListDAO.java:188)
        at oracle.tip.adapter.file.inbound.PollWork.(PollWork.java:236)
        at oracle.tip.adapter.file.FileResourceAdapter.endpointActivation(FileResourceAdapter.java:222)
        at oracle.tip.adapter.sa.impl.fw.jca.AdapterFrameworkImpl.endpointActivation(AdapterFrameworkImpl.java:498)
        at oracle.tip.adapter.sa.impl.inbound.JCABindingActivationAgent.activateEndpoint(JCABindingActivationAgent.java:336)
        at oracle.tip.adapter.sa.impl.JCABindingServiceImpl.activate(JCABindingServiceImpl.java:113)


the class is in C:\Oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar

or in
C:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar

(better use the latter...)


and in oracle.tip.adapter.file.inbound.FileListDAO there is clearly a dependency:
import oracle.integration.platform.blocks.FabricConfigManager;
import oracle.integration.platform.kernel.FabricMeshUtils;



When loading this class fails, you will see in the logs "Unable to retrieve database info"

After adding the fabric-runtime.jar file to $DOMAIN_HOME/lib, I still get:




While trying to lookup 'soa-infra:comp.ApplicationContext' didn't find subcontext 'soa-infra:comp'. Resolved ''
javax.naming.NameNotFoundException: While trying to lookup 'soa-infra:comp.ApplicationContext' didn't find subcontext 'soa-infra:comp'. Resolved ''; remaining name 'soa-infra:comp/ApplicationContext'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at oracle.integration.platform.kernel.FabricMeshUtils.getApplicationContext(FabricMeshUtils.java:57)
at oracle.tip.adapter.file.inbound.FileListDAO.<init>(FileListDAO.java:188)
at oracle.tip.adapter.file.inbound.PollWork.<init>(PollWork.java:236)
at oracle.tip.adapter.file.FileResourceAdapter.endpointActivation(FileResourceAdapter.java:222)
at oracle.tip.adapter.sa.impl.fw.jca.AdapterFrameworkImpl.endpointActivation(AdapterFrameworkImpl.java:498)
at oracle.tip.adapter.sa.impl.inbound.JCABindingActivationAgent.activateEndpoint(JCABindingActivationAgent.java:336)
at oracle.tip.adapter.sa.impl.JCABindingServiceImpl.activate(JCABindingServiceImpl.java:113)
at com.bea.wli.sb.transports.jca.binding.JCATransportInboundOperationBindingServiceImpl.activateService(JCATransportInboundOperationBindingServiceImpl.java:325)






RESOLUTION: we decided to ignore this message, if you want to configure the FileAdapter for useCompression you can do so with the JCA Activation Properties.
I assume all works fine in SOA Suite, where the FabricMeshUtils is surely available in the classpath.



In fact, further investigation proves that the only side effect of this error is that the useCompression (default: false) flag can be set only using the JCA Activation Properties, and not with a DB value (in any case OSB doesn't use any DB to store configuration information).


Saturday, May 26, 2012

The FTP MOVE operation with a JCA FTP Adapter

the difference between the case with RNFR-RNTO and the case of COPY/DELETE. The difference is simpls using

UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"

in the dynamic JCA properties of the Business Service built on top the JCA FTPAdapter


THIS IS THE GOOD CASE, with
UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"


the MOVE is done with a RNFR-RNTO:

[ INFO] 2012-05-25 23:41:17,664 [myuser] [10.19.10.100] RECEIVED: RNFR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,665 [myuser] [10.19.10.100] SENT: 350 Requested file action pending further information.

[ INFO] 2012-05-25 23:41:17,666 [myuser] [10.19.10.100] RECEIVED: RNTO /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,667 [myuser] [10.19.10.100] File rename from "/myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml" to "/myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml"
[ INFO] 2012-05-25 23:41:17,668 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, file renamed.


THIS IS THE BAD CASE, without using the "UseNative" options: the move is done by RETRIEVING locally the file, COPYING it to destination and DELETING the remote source:


[ INFO] 2012-05-25 23:47:17,806 [myuser] [10.19.10.100] RECEIVED: RETR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,807 [myuser] [10.19.10.100] File downloaded /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] Releasing unreserved passive port: 54862
[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.

[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 226 Transfer complete.

[ INFO] 2012-05-25 23:47:17,847 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.

[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] RECEIVED: TYPE I
[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] SENT: 200 Command TYPE okay.

[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.

[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] RECEIVED: CWD /myuser/environments/env-0/ave
[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] SENT: 250 Directory changed to /myuser/environments/env-0/ave

[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] RECEIVED: PASV
[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] SENT: 227 Entering Passive Mode (10,56,5,192,234,152)

[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] RECEIVED: STOR POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] File uploaded /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] Releasing unreserved passive port: 60056
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.

[ INFO] 2012-05-25 23:47:17,854 [myuser] [10.19.10.100] SENT: 226 Transfer complete.

[ INFO] 2012-05-25 23:47:17,894 [myuser] [10.19.10.100] RECEIVED: CWD /
[ INFO] 2012-05-25 23:47:17,895 [myuser] [10.19.10.100] SENT: 250 Directory changed to /

[ INFO] 2012-05-25 23:47:17,896 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,897 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.

[ INFO] 2012-05-25 23:47:17,898 [myuser] [10.19.10.100] RECEIVED: DELE /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] File delete : myuser - /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, deleted /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml.





note: those options are totally undocumented

you need to add this

<jca:dynamic-endpoint-properties>
        <jca:endpoint-property>
          <jca:name>UseNativeRenameOperation</jca:name>
          <jca:value>true</jca:value>
        </jca:endpoint-property>
        <jca:endpoint-property>
          <jca:name>UseFtpRenameOperation</jca:name>
          <jca:value>true</jca:value>
        </jca:endpoint-property>
      </jca:dynamic-endpoint-properties>

in your BS at the end of the tran:provider-specific section


These events are visible also in the WLS logs if you enable java:alsb-jca-framework-adapter-debug in alsbdebug.xml

Thursday, January 19, 2012

A callout cannot invoke a one-way operation

I have created a DBAdapter JCA Client invoking an INSERT operation
JDeveloper generates this WLSD:

<?binding.jca AcmeDBInsert_db_db.jca?>
<wsdl:definitions name="AcmeDBInsert_db" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/AcmePOC_Sharath/Acme_POC_Acme_WMS/AcmeDBInsert_db" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/AcmePOC/Acme_POC_Acme_WMS/AcmeDBInsert_db" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/AcmeDBInsert_db">
    <plt:partnerLinkType name="AcmeDBInsert_db_plt">
        <plt:role name="AcmeDBInsert_db_role">
            <plt:portType name="tns:AcmeDBInsert_db_ptt"/>
        </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AcmeDBInsert_db" schemaLocation="xsd/AcmeDBInsert_db_table.xsd"/>
        </schema>
    </wsdl:types>
    <wsdl:message name="GmAcmeTrackerCollection_msg">
        <wsdl:part name="GmAcmeTrackerCollection" element="top:GmAcmeTrackerCollection"/>
    </wsdl:message>
    <wsdl:portType name="AcmeDBInsert_db_ptt">
        <wsdl:operation name="insert">
            <wsdl:input message="tns:GmAcmeTrackerCollection_msg"/>
        </wsdl:operation>
    </wsdl:portType>
</wsdl:definitions>



the "insert" operation is a one-way operation (no wlsd:output clause)

The problem is that the Service Callout expects a request-reply pattern.

So in this case you must necessarily use a Publish, with Quality of Service "Exactly Once" to execute in the same transaction and with a blocking operation.

Tuesday, January 3, 2012

javax.resource.spi.InvalidPropertyException: Duplicate Property Values Exception. The properties [xADataSourceName] and [dataSourceName (both in connector properties)] can not both be [jdbc/SOADataSource].

ok, I have done it again...


in the JCA file adapter outbound connection pool instance, you should configure only.
either dataSourceName, or xADataSourceName... NOT BOTH! Du blöder Einer! Dummkopf!


* "Du blöder Einer" is a yiddish-german expression. it means "you stupid"

Tuesday, December 13, 2011

Using JCA JMS Adapter in OSB

[JCATransport:381984]OSB JCA transport does not support adapter type: JMS

This puts an abrupt end to my adventure :o(

Saturday, December 3, 2011

OSB move remote file with JCA FTP Adapter

A common requirement is to add a bit of transactional behavior in FTP operations:

Example:

- FTP file1 to remote dir /path/to/myfiles
- FTP file2 to remote dir /path/to/myfiles
- tell remote system that he can start processing file1 and file2

If FTP of file2 fails, you don't want to leave file1 hanging around.
So you should add a fastidious compensation action in the Error Handler of "FTP file2" to undo the "FTP file1" operation.
Also, fastidiously the file could be picked up by remote system before I end transferring it (it should not happen, I guess it depends on the FTP server implementation, it's just one extra concern I have).

This clearly sucks.

Luckily the Oracle JCA FTP Adapter supports moving remote files.

The FTPMove operation with Type="MOVE" has been successfully tested, using Transport Headers to pass the "file name from" and "to" parameters to the JCA Adapter.

Interestingly enough, you can also COPY and DELETE files remotely.

So our flow will be:

- FTP file1 to remote dir /path/to/myfilestemp
- FTP file2 to remote dir /path/to/myfilestemp
- FTP move file1 to /path/to/myfiles
- FTP move file2 to /path/to/myfiles


Ok you will say "what if - ##FTP move file2 to /path/to/myfiles## fails?".
Well, I guess that can happen....

Wednesday, November 23, 2011

Error FTPing with JCA FTP Adapter


BEA-381971


Invoke JCA outbound service failed with connection error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/ACME_PurchaseOrder/PV_FtpToACME [ Put_ptt::Put(body) ] - WSIF JCA Execute of operation 'Put' failed due to: Error in establishing connection to FTP Server.
Error in establishing connection to FTP Server.
Unable to establish connection to server.
; nested exception is:
BINDING.JCA-11438
Error in establishing connection to FTP Server.
Error in establishing connection to FTP Server.
Unable to establish connection to server.
Please ensure hostname and port specified to login to the server is correct.



The FTP Put is done in a Local Transaction:

in the log you will find:

JCA_FRAMEWORK_AND_ADAPTER Starting JCA LocalTransaction

and when the error occurs:

JCA_FRAMEWORK_AND_ADAPTER Rolling back JCA LocalTransaction

For the NoTransConnEventListener of pool 'eis/Ftp/ACMEFtpAdapter' CONNECTION_CLOSED event received

servicebus:/WSDL/ACME_PurchaseOrder/PV_FtpToACME [ Put_ptt::Put(body) ] - Marking this exception as Locally Retryable

WSIFCache: Closing CCI Connection

In fact the JCA Adapter for File and FTP do not support XA Transaction, but only Local Transactions.


The message is retried the number of times determined by the Business Service generated on top of the JCA Adapter:

Transport Configuration
Protocol jca
Load Balancing Algorithm round-robin
Endpoint URI
jca://eis/Ftp/ACMEFtpAdapter
Retry Count 2
Retry Iteration Interval 30
Retry Application Errors No

So in this case the message will be tried 3 times (2 retries) before erroring out. The local transaction only is retried, while the global transaction is still active. This makes the global transaction last 60 seconds.

Be aware that these local transactions are executed as part of the Proxy Service transaction: if you define 10 retries at 1 minute interval, your global transaction will be open for 10 minutes. So this is not a viable solution.

This is what you will see at the end of the TX:

<BEA-010213> <Message-Driven EJB: RequestEJB-7263521924761754948--49bf0c34.133cb4ae47d.-7fe0's transaction was rolled back. The transaction details are: Xid=BEA1-01DB458350C2A589D5FB(10150583),Status=Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException: setRollbackOnly called on transaction],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=306,seconds left=60,XAServerResourceInfo[WLStore_prod_domain_FileStore_auto_1]=(ServerResourceInfo[WLStore_prod_domain_FileStore_auto_1]=(state=rolledback,assigned=osb_server1),xar=WLStore_prod_domain_FileStore_auto_121108363,re-Registered = false),SCInfo[prod_domain+osb_server1]=(state=rolledback),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=osb_server1+pierrepc:7011+prod_domain+t3+, XAResources={eis/tibjms/Topic, WLStore_prod_domain_FileStore_auto_1, eis/aqjms/Queue, eis/fioranomq/Topic, eis/wls/Queue, eis/tibjms/Queue, eis/activemq/Queue, WLStore_prod_domain_ACMEFileStore1, eis/pramati/Queue, WLStore_prod_domain__WLS_osb_server1, eis/tibjmsDirect/Queue, eis/Apps/Apps, eis/jbossmq/Queue, eis/sunmq/Queue, WSATGatewayRM_osb_server1_prod_domain, eis/aqjms/Topic, eis/tibjmsDirect/Topic, eis/wls/Topic, eis/AQ/aqSample, wlsbjmsrpDataSource_prod_domain, eis/webspheremq/Queue, WLStore_prod_domain_WseeFileStore_auto_1},NonXAResources={})],CoordinatorURL=osb_server1+pierrepc:7011+prod_domain+t3+).>


Go to the Server/MOnitoring/JTA/Transaction tab and you will see the transaction open for the entire duration of the retries. The transactionId is also traced in the logs.

We were consuming the message from a JMS queue, and redirecting on error to an ErrorQueue.

Monday, November 14, 2011

Security and Authentication in JCA FTP File Adapter

I have setup a Credential Mapping to be able to do a Opaque FTP Put with the JCA FTP Adapter, as documented here

It maps a WebLogic user into a FTP EIS User.

I still get an authentication error:



####<13-Nov-2011 22:26:29 o'clock CET> <Error> <WliSbTransports> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-07F5BFB39FA8A589D5FB> <9218d6466d04a9d6:4f7d3afe:1339e75d3c7:-8000-00000000000000e4> <1321219589928> <BEA-381502> <Exception in JmsInboundMDB.onMessage: com.bea.wli.sb.transports.TransportException: <jca-transport-application-error xmlns="http://www.bea.com/wli/sb/transports/jca">
<jca-transport-error-message>Invoke JCA outbound service failed with application error</jca-transport-error-message>
<jca-runtime-fault-detail>
<eis-error-code>501</eis-error-code>
<eis-error-message>501 Syntax error</eis-error-message>
<exception>com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/Phoenix_PurchaseOrder/WriteToWMOS_FTP [ Put_ptt::Put(opaque) ] - WSIF JCA Execute of operation 'Put' failed due to: Error in logging in.
Error in logging in.
Unable to log in to the server.
; nested exception is:
BINDING.JCA-11439
Error in logging in.
Error in logging in.
Unable to log in to the server.
Please ensure userid and password specified to login to the server is correct.




To understand what is going on, I enable debug flag alsb-jca-framework-adapter-debug as explained here



All I get is :




Caused by: BINDING.JCA-11439
Error in logging in.
Error in logging in.
Unable to log in to the server.
Please ensure userid and password specified to login to the server is correct.

at oracle.tip.adapter.ftp.FTPClient.regularLogin(FTPClient.java:1630)
at oracle.tip.adapter.ftp.FTPClient.login(FTPClient.java:1593)
at oracle.tip.adapter.ftp.FTPAgent.login(FTPAgent.java:1170)
at oracle.tip.adapter.ftp.FTPAgent.preCall(FTPAgent.java:1632)
at oracle.tip.adapter.ftp.FTPAgent.validateOutputDir(FTPAgent.java:1230)
at oracle.tip.adapter.file.outbound.FileInteraction.validateDirectory(FileInteraction.java:2676)
at oracle.tip.adapter.file.outbound.FileInteraction.executeFileWrite(FileInteraction.java:547)
at oracle.tip.adapter.ftp.outbound.FTPInteraction.execute(FTPInteraction.java:251)
at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:529)
... 62 more





and there is no way to log the actual username/password it is using to login into the FTP server


I am using Filezilla Server, I disable the Miscellaneous/Don't show password in logs, and I enable logging on the server.

What I find is disconcerting:


(000033) 13-11-2011 21:46:48 - (not logged in) (127.0.0.1)> USER
(000033) 13-11-2011 21:46:48 - (not logged in) (127.0.0.1)> 501 Syntax error


while the normal sequence should be:


(000037) 13-11-2011 21:57:07 - (not logged in) (fe80::5950:1b46:fefe:aa61)> USER someuser
(000037) 13-11-2011 21:57:07 - (not logged in) (fe80::5950:1b46:fefe:aa61)> 331 Password required for someuser
(000037) 13-11-2011 21:57:07 - (not logged in) (fe80::5950:1b46:fefe:aa61)> PASS somepassword
(000037) 13-11-2011 21:57:07 - someuser (fe80::5950:1b46:fefe:aa61)> 230 Logged on


normally after USER I should see a username.... this means that the mapping fails.

The case is reported here


I notice that the log statement reports "anonymous". If you go to deployment, FtpAdapter, Security, Principal you can set "weblogic" and principal, and make sure that you also use weblogic in the Credential Mapping.
This is not enough.

In the $inbound of the OSB request I notice:


<con:security>
<con:transportClient>
<con:username><anonymous></con:username>
</con:transportClient>
</con:security>



so I create a weblogicServiceAccount for username weblogic, associate it to the Proxy JMS Service Account (hoping to make the OSB proxy "run as" the weblogic username, but I get this in the logs:


ServiceAccountRuntimeManagerImpl.getUsernamePasswordCredential = this: com.bea.wli.sb.svcacct.ServiceAccountRuntimeManagerImpl@17d3da

Could not find credentials on admin server: java.lang.IllegalArgumentException: com.bea.wli.sb.management.configuration.ServiceAccountRuntime is not an interface

com.bea.wli.sb.svcacct.ServiceAccountRuntimeCache@1e49c6b$ServiceAccountRuntimeCache.get(Acme_PurchaseOrder/weblogicServiceAccount)

ServiceAccountRuntimeCache.get(Acme_PurchaseOrder/weblogicServiceAccount) returned ServiceAccountRuntime[Acme_PurchaseOrder/weblogicServiceAccount]



and the $inbound still shows anonymous user


Anyway, at the end I do:

Deployments/FtpAdapter/Security/Credential Mapping/New/Unauthenticated User and I map it to the FTP user.... works like magic!


The alternative is to specify a username/password in the JCA Outbound Connection Pool instance properties (there are 55 properties, only 10 shown in the first page... they are in alphabetical order, so yuoi must go to the last page)





One day I will figure out how to attach a WebLogic principal to an incoming JMS request... security has always been my Achilles' heel

Thursday, November 10, 2011

JCATransport:381987 in JCA FTP Adapter

I have created a FTP Adapter in JDeveloper 11.1.1.5 and imported in OSB.

When I activate, I get this beautiful conflict


[JCATransport:381987]An error occured while validating JCA transport endpoint. JNDI lookup with URL: jca://eis/ftp/FtpAdapter failed. Missing JNDI configuration such as undeployed or misconfigured JCA Adapter RAR or connection factory.



Well, embarrassingly enough it turns out that the actual JNDI Binding name is eis/Ftp/FtpAdapter and not eis/ftp/FtpAdapter (upper case F) as proposed by

I wonder how such a blunder could take place in JDeveloper...



Sunday, October 30, 2011

High Availability File Adapter in OSB

While running the FileAdapter (eis/FileAdapter) in a cluster with 2 instances, I get this error

BINDING.JCA-11042 File deletion failed

the full error is

onFatalError: Adapter forced endpoint deactivation due to:
BINDING.JCA-11042
File deletion failed.

here https://forums.oracle.com/forums/thread.jspa?threadID=2157695 and here https://kr.forums.oracle.com/forums/thread.jspa?messageID=9757727 and here https://cn.forums.oracle.com/forums/thread.jspa?threadID=2252967 they report the same story.


OK, we need to use eis/HAFileAdapter and give a controlDir. But we are not having a SOAINFRA DB schema because we installed only OSB.

see High Availability in Inbound Operations here http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_file.htm

it is not clear if you have an option to use a file as a coordinator, instead of a DB. What is controlDir for?

http://download.oracle.com/docs/cd/E14571_01/doc.1111/e17059.pdf here the HA FileAdapter documentation


This document is also quite cool, it says:

"Database-based mutex and locks are used to coordinate these operations in a File Adapter clustered topology. Other coordinators are available but Oracle recommends using the Oracle Database."

yet they don't mention the alternatives.... if you use a DB, then it must be a HA DB otherwise a DB failure would mean a File Adapter failure...



see also here for full solution

Stuck Threads when using JCA FileAdapter

you will notice that the Server Health has a Warning, and there are 5 stuck threads

one of this type:


"[STUCK] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'" TIMED_WAITING

java.lang.Thread.sleep(Native Method)

oracle.tip.adapter.file.inbound.PollWork.run(PollWork.java:369)

weblogic.work.ContextWrap.run(ContextWrap.java:41)

weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)

weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

weblogic.work.ExecuteThread.run(ExecuteThread.java:178)



and 4 of this type:


"[STUCK] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock oracle.tip.adapter.file.inbound.FilesToProcess@4bdddc TIMED_WAITING

java.lang.Object.wait(Native Method)

oracle.tip.adapter.file.inbound.FilesToProcess.dequeueToProcess(FilesToProcess.java:101)

oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:269)

weblogic.work.ContextWrap.run(ContextWrap.java:41)

weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)

weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

weblogic.work.ExecuteThread.run(ExecuteThread.java:178)




according to Oracle documentation for the DB adapter this is normal. They don't mention File Adapter....


The solution is to create a WorkManager with the option “ignore stuck threads” and assign it as a dispatch policy to each Proxy Service using the FileAdapter

Wednesday, January 19, 2011

JDeveloper File Adapter working in OSB

We imported in OSB the .jca, .wsdl and .xsd files generated by the File Adapter Wizard and Native Format Language in JDeveloper.

Once imported in Eclipse (Import/Import/File System), right click on the JCA file, and "generate service": this will generate a Proxy Service based on JCA.

You can choose to keep your setting in the JCA file, or to customize them in the Proxy Service.

The beautiful thing is that the nxsd extension are recognized and the XML generated exactly as it was run in SOA Suite. I prefer by far NFL than MFL.


Here the official 11.1.1.4 doc for FileAdapter