How do I call a JCA Adapter from a Java Client?
I was able to call an EJB that I deployed on the OC4J server from a client that sat outside the OC4J server. I am now trying to use a similar client for the jca adapter but I keep getting errors. I'm trying to use the adapter to send XML by calling the execute method in the cciInteraction class? Can I simply create a client as I am doing, capture the adapter and call a class contained in it? What am I getting this error below?
Mike
Code
package milo;
import com.ariba.asc.jcaadapter.CCIConnection;
import com.sun.corba.se.impl.javax.rmi.PortableRemoteObject;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.ariba.asc.jcaadapter.sample.ra.OutboundClientInteraction;
import javax.activation.DataSource;
import javax.annotation.Resource;
import javax.jms.ConnectionFactory;
public class ResourceAdapterClient {
public static void main(String [] args) {
try {
Context initialContext = getInitialContext();
javax.resource.cci.ConnectionFactory cf = (javax.resource.cci.ConnectionFactory)initialContext.lookup("eis/jca/standaloneEIS");
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "oc4jadmin" );
env.put(Context.PROVIDER_URL, "ormi://ga011hds.unix.us.ups.com:12401/EAR");
return new InitialContext( env );
Error:
Apr 16, 2010 4:21:12 PM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
WARNING: Exception returned by remote server: {0}
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:58)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:948)
at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:349)
at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:305)
at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:287)
at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:157)
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:131)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException: The Adapter specific implementation configuration is not initialized
at com.ariba.asc.jcaadapter.impl.AdapterImplManager.getAdapterImplConfiguration(AdapterImplManager.java:232)
at com.ariba.asc.connector.log.LogManager.initFactory(LogManager.java:40)
at com.ariba.asc.connector.log.LogManager.getLogger(LogManager.java:33)
at com.ariba.asc.jcaadapter.CCIConnectionFactory.<clinit>(CCIConnectionFactory.java:46)
... 17 more
javax.naming.NamingException: Lookup error: javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError]; nested exception is:
javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError] [Root exception is javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError]]
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:72)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at milo.SessionEJBClient.main(SessionEJBClient.java:30)
Caused by: javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError]
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:100)
at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMIClientConnection.java:442)
at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:236)
at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:302)
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:59)
... 2 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:58)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:948)
at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:349)
at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:305)
at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:287)
at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:157)
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:131)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
at java.lang.Thread.run(Thread.java:595)
at com.evermind.server.rmi.RMICall.warningExceptionOriginatesFromTheRemoteServer(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:91)
... 6 more
Caused by: java.lang.IllegalStateException: The Adapter specific implementation configuration is not initialized
at com.ariba.asc.jcaadapter.impl.AdapterImplManager.getAdapterImplConfiguration(AdapterImplManager.java:232)
at com.ariba.asc.connector.log.LogManager.initFactory(LogManager.java:40)
at com.ariba.asc.connector.log.LogManager.getLogger(LogManager.java:33)
at com.ariba.asc.jcaadapter.CCIConnectionFactory.<clinit>(CCIConnectionFactory.java:46)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:58)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:948)
at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:349)
at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:305)
at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:287)
at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:157)
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:131)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
at java.lang.Thread.run(Thread.java:595)
Process exited with exit code 0.
Can anyone help?
Mike
Similar Messages
-
How can i call a jasper report from a java Application
Hi,
i am chiranjit , currently i working in a web based ERP project, in this project as a report building tool we are using JasperReport wih eclipse plugin . in eclipse report's are generating very well but i am unable to call that report from a java application because i have no idea about the How to call a Jasper Report from a Java Application . so please send me the necessary class names, jar files names and programe code as early as possible.
ChiranjitAhh, kind of a duplicate thread:
http://forums.java.sun.com/thread.jspa?threadID=631642
@OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
� {� -
How can i call a VB6 project from my java application using JNI
hi
can anyone tell me the procedure of calling a VB6 project from any java application using JNI
if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
if anyone know that procedure of creating dll file of an existing VB6 project please reply
please if anyone know then let me knowAhh, kind of a duplicate thread:
http://forums.java.sun.com/thread.jspa?threadID=631642
@OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
� {� -
How do I call another exe file from a Java program?
Hi,
I am doing a simple IDE (text editor/interpreter) for a simple programming language we are developing. It will be submitted as our project for this semester. I created an exe file (in C) which will be used as the interpreter. How do I call the interpreter from my IDE? The interpreter should run when the user clicks a button (i.e. the "Run" button). I've tried the Java Runtime class but it doesn't work. Anyone who knows how to do it?
Thanks!I first tried to do a simple program that calls system commands such as dir, cd <dir>, etc.
I do not have the exact code right now but as far as I can remember, here's what I wrote:
class Sample{
public static void main(String args[]) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String command;
while ((command = in.readLine()).equalsIgnoreCase("exit") == false){
try{
Runtime.getRuntime().exec(command);
}catch(Exception e){
System.err.println("Error: " + e);
System.exit(0);
} -
How to insert message in OC4J JMS from standalone java client.
Hi,
I have been following available examples for creating standalone java clients to insert messages in JMS queues.
I am able to insert using java client when the SOA suite and the standalone java code are on same machine.
package producerconsumerinjava;
import javax.jms.*;
import javax.naming.*;
import java.util.Hashtable;
public class QueueProducer
public static void main(String[] args)
String queueName = "jms/demoQueue";
String queueConnectionFactoryName = "jms/QueueConnectionFactory";
Context jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
Queue queue = null;
QueueSender queueSender = null;
TextMessage message = null;
int noMessages = 5;
* Set the environment for a connection to the OC4J instance
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS, "mypass");
env.put(Context.PROVIDER_URL,"ormi://myserver.company.com:12402"); //12402 is the rmi port
* Set the Context Object.
* Lookup the Queue Connection Factory.
* Lookup the JMS Destination.
try
jndiContext = new InitialContext(env);
queueConnectionFactory =
(QueueConnectionFactory) jndiContext.lookup(queueConnectionFactoryName);
queue = (Queue) jndiContext.lookup(queueName);
catch (NamingException e)
System.out.println("JNDI lookup failed: " + e.toString());
System.exit(1);
* Create connection.
* Create session from connection.
* Create sender.
* Create text message.
* Send messages.
* Send non text message to end text messages.
* Close connection.
try
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession =
queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue);
message = queueSession.createTextMessage();
for (int i = 0; i < noMessages; i++)
message.setText("Message " + (i + 1));
System.out.println("Producing message: " + message.getText());
queueSender.send(message);
queueSender.send(queueSession.createBytesMessage());
catch (JMSException e)
System.out.println("Exception occurred: " + e.toString());
finally
if (queueConnection != null)
try
queueConnection.close();
catch (JMSException e)
System.out.println("Closing error: " + e.toString());
But when the SOA Suite is remote, I am struggling to get the settings correct
Till now, here is what I have figured out from looking at blogs/tars etc on the Net:
1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactory (http://download.oracle.com/docs/cd/E14101_01/doc.1013/e13975/jndi.htm)
2. The project should have a META-INF/application-client.xml file, which may be dummy (http://www.wever.org/java/space/Oracle/JmsTar1). Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.
Errors:
When trying to run exact same code on local server that tries to enqueue JMS on remotee serverer
Exception occurred: javax.jms.JMSException: Unable to create a connection to "xxxxxxx.yyyyyy01.dev.com/10.42.456.11:12,602" as user "null".
Any help is greatly welcome.
As an exercise, I copied this complete code on the server and then ran locally using a telnet client...it worked. So the problem is coming when accessing the server remotely.
Rgds,
Amit1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactoryNot necessarily.
2. The project should have a META-INF/application-client.xml fileThat's only necessary if going the ApplicationClientInitialContextFactory route.
There are two types of JMS client applications you can write -- a pure/plain Java app, and an "AppClient". That first is your everyday run-of-the-mill Java application, nothing special. That latter is a special, complicated beast that tries to act as a part of the whole client/server/J2EE architecture which provides you with a semi-managed environment. Either can be made to work, but if all you need is JMS access (using plain OC4J JMS factory/queue names and not JMS Connector names), then the first is easier to get working (and performs a tiny bit better as well due to being a lighter-weight solution).
I think the problem you are having might be: When you use the plain Java client solution, you do not have any type of management, and that includes user management. With no user management (and if the JMS server is not configured to allow anonymous connections) you need to include the username and password in the call to createConnection. (I think it may be that this is actually true in the AppClient case as well -- I avoid using the AppClient model as much as possible so my memory there is weaker.)
If you prefer to go the AppClient route, I would point you to a demo I wrote which had a functioning example, but Oracle seems to have removed it (and all of the 10.1.3 demos?) from OTN. :-(
Hmm, it seems to still be available on the wayback machine:
http://web.archive.org/web/20061021064014/www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
(Just look down the page for "With OEMS JMS (In-Memory and File-Based)" -- there is an .html document with info, and there is a .zip file with source code.)
Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.The app client in my demo had the following directory structure:
myjavaclient.class
jndi.properties
META-INF\MANIFEST.MF
META-INF\application-client.xml
META-INF\orion-application-client.xml
When you use ApplicationClientInitialContextFactory I think it just looks under .\META-INF for the .xml files.
-Jeff -
How to send a request to servlet from a java client.
I called a servlet from java client using URL object.
I could establish a connection with server and display
the content(like req.getservername etc.,)
of servlet on client side(DOS prompt).
My question is how do i send a request to servlet from the client.
let me say, i have to send a value as 10 to servlet and do some processing
( like 10*2 = 20) display the output (20) on client side..
It will be appreciated if u can mention the syntax...just add the query string to the url you use to create the URL object from.
-
How do you call a JavaScript function from a Java applet
I have an Applet that needs to run on the following platforms: Internet Explorer (Windows-NT, Windows -2000), Netscape (Windows-NT, Windows-2000, Sun(Solaris), RedHat(Linux), HP(11.0), IBM(AIX)).
The Applet needs to call a JavaScript function that is included on the HTML page that contains the applet. In JRE-1.3.1 I used the AppletContext.showDocument(url,"_self" ) where the url is "javascript:MyScript('param1')". This works just fine. I tried using showDocument without the second parameter and all the other choices for the second parameter and none of them worked (nothing happened).
I tried the same code with JRE version 1.4-beta. It seems that version 1.4-beta no longer supports a URL that starts with "javascript" in the AppletContext.showDocument(url,"_self" ) method. The error is:
netscape.javascript.JSException: call does not support self.open
at sun.plugin.javascript.navig.Window.call(Unknown Source)
at sun.plugin.ActivatorAppletContext.showDocument(Unknown Source)
I tried to catch the JSException but I cannot seem to.
I then tried a completely different approach. I then grabbed the JSObject for the page and tried to call my javascript function (MyScript) directly:
JSObject theObj = JSObject.getWindow(this);
Object paramArray[] = new Object[1];
paramArray[0] = Param1;
theObj.call("MyScript", paramArray);
This worked fine on Netscape[Windows-NT, Windows-2000]. HP throws a JSException on getWindow() and Solaris just hangs. I did not even try IE.
What is the recommended approach here?you can try this, it worked for me:
JSObject win = JSObject.getWindow(this);
win.eval(function_call);
I have other ways also, so if this doesn't work, let me know. -
Calling a Session bean from a java client
Hi
I have been using OC4J for quite some while now, and I have a lot of programs to test my session beans. But with the new versions of the container 9.0.2.0.0 production release and 9.0.3.0.0 pre-release J2EE 1.3 certified, all my test program hang in the lookup method. I have an earlier pre-release of 9.0.3.0.0 (the same version number but not j2EE 1.3 certified -> confusing) where my test programs works without any problems.
I have included a small code sample of how I call the session beans.
I hope some one can see what I'm doing wrong or what have changed compared to the earlier versions!
/Thanks
Morten
Properties prop = new Properties();
prop.put Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
prop.put(Context.PROVIDER_URL, "ormi://mma:23791/rmitest" );
prop.put(Context.SECURITY_PRINCIPAL, "admin");
prop.put(Context.SECURITY_CREDENTIALS, "welcome");
Context ctx = new InitialContext(prop);
//look up jndi name
Object ref = ctx.lookup("Enterprise1");I got i working right now, it seems like I was using the wrong version of oc4j.jar and ejb.jar when I was building my project!
-
How to invoke a proxy service from a java client
Hi all,
how could I invoke a proxy service from a java client ?
The proxy service type is 'any xml service' with http protocol.
For a proxy with web service type I can export the related WSDL and generate the java client source.
With 'any xml service' there is no associated wsdl and I'm wondering how to do that.
Thanks
ferpHi Ferp,
I used ClientGEN to generate client files from WSDL deployed in ALSB. You can also use Axis for client file generation.
You need to know the WSDL URL. Generate Client files from WSDL URL.
Sample ANT Script
<project name="simple-web" default="mytask" basedir=".">
<taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" classpath="C:\bea92\weblogic92\server\lib\weblogic.jar"/>
<target name="mytask" description="Generate web service client">
<clientgen wsdl="http://<hostname>:<port>/URL?WSDL"
destDir="src"
packageName="com.client.mytask"
classpath="${java.class.path}" />
</target>
</project>
Use the following JAVA Code,
try {
ActivationService service = new ActivationService_Impl("http://<hostname>:<port>/url?WSDL");
client = service.getActivationServicePort();
} catch (Exception ex) {
// Handle Exception
client.activateNumber();
Let me know if you need any more information.
Thanks,
Suman. -
How do I run a JCA adapter when I am calling it from an EJB?
How do I run a JCA adapter when I am calling it from an EJB? Do I need to create an EJB client and place it in a Client container? If my EJB and JCA adapter are deployed is there a way to call my EJB from the command line?
MikeHi. When you look at the code I provided for you in other thread you will see that connecting to adapter is done through JNDI lookup. The creation of the adapter is done in your J2EE server. Here is some code for you where you can find mapping from code to ejb-jar and orion-ejb-jar.
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
version="2.1">
<!--
This file declares the interface (needs/promises) of the message-driven bean.
The MDB requires:
- a JMS queue (to receive messages from the client),
- a JMS exception queue (to send undeliverable messages back to the source), and
- a connection factory (to communicate with a JMS resource provider).
Note that communication with the resource provider may be (and for this
application is) via a JMS Connector rather than direct.
-->
<display-name>JMS Consume MDB - opp-ifs</display-name>
<enterprise-beans>
<entity>
<description>Entity Bean ( BMP )</description>
<display-name>EBEjbMecomsIFS</display-name>
<ejb-name>EBEjbMecomsIFS</ejb-name>
<local-home>EBEjbMecomsIFSLocalHome</local-home>
<local>EBEjbMecomsIFSLocal</local>
<ejb-class>EBEjbMecomsIFSBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>false</reentrant>
<service-ref>
<service-ref-name>service/interceptor</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
<wsdl-file>META-INF/wsdl/MHS5_Jms_In_RS.wsdl</wsdl-file>
<service-qname xmlns:ns="http://oracle.com/esb/namespaces/PilotOWSM_MustHavesScenario5">ns:ESB_MHS5_Jms_In_RS_Service</service-qname>
</service-ref>
</entity>
<message-driven>
<display-name>JMS Consume MDB - MDB</display-name>
<ejb-name>MDBEjbMecomsIFS</ejb-name>
<!-- name of bean in deployment descriptor (including orion-ejb-jar.xml file) -->
<ejb-class>MDBEjbMecomsIFSBean</ejb-class>
<!-- bean's fully qualified Java class name -->
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<!-- allow incoming messages to be included in transactions -->
<!-- The ejb requires a connection factory to access an external resource (JMS). -->
<ejb-local-ref>
<ejb-ref-name>ejb/local/EBEjbopp_ifs</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>EBEjbMecomsIFSLocalHome</local-home>
<local>EBEjbMecomsIFSLocal</local>
<ejb-link>EBEjbMecomsIFS</ejb-link>
</ejb-local-ref>
<resource-ref>
<!-- The resource's connection factory must be accessible at jndi location "java:comp/env/jms/QueueConnectionFactory". -->
<res-ref-name>jms/QueueConnectionFactory</res-ref-name>
<!-- The resource's connection factory must implement the "javax.jms.ConnectionFactory" interface. -->
<res-type>javax.jms.ConnectionFactory</res-type>
<!-- container managed authorization -->
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<!--
Declare that a global transaction is required when the onMessage method of the ejb named
"MDBEjbName" is called. This will cause the app server to automatically initiate a
global (XA) transaction before calling onMessage (actually, before even receiving the JMS
message that triggers onMessage) and end the transaction after onMessage returns. The
JMS Connector will automatically rollback the transaction if onMessage throws an
exception. onMessage may also set the transaction to be "rollback only".
Participating in global transactions requires that the connection factory provided in the
activation spec (see the ConnectionFactoryJndiName property earlier in this file) must be
XA-capable (it must implement the javax.jms.XAConnectionFactory interface).
If this declaration is ommitted, then onMethod will not be part of any global
transaction. In that case the connection factory provided in the activation spec must
implement the javax.jms.ConnectionFactory interface.
-->
<container-transaction>
<method>
<ejb-name>MDBEjbMecomsIFS</ejb-name>
<method-name>onMessage</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>EBEjbMecomsIFS</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
orion-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<orion-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNameSpaceSchemaLocation="http://www.oracle.com/technology/oracleas/schema/orion-ejb-jar-10_0.xsd">
<enterprise-beans>
<entity-deployment name="EBEjbMecomsIFS">
<service-ref-mapping name="service/interceptor">
<wsdl-location>http://on-poc62.ontw.alfa.local:7777/event/PilotOWSM/MustHavesScenario5/MHS5_Jms_In_RS?wsdl</wsdl-location>
<service-qname localpart="ESB_MHS5_Jms_In_RS_Service" namespaceURI="http://oracle.com/esb/namespaces/PilotOWSM_MustHavesScenario5"/>
<port-info>
<wsdl-port namespaceURI="http://oracle.com/esb/namespaces/PilotOWSM_MustHavesScenario5"
localpart="__soap_MHS5_Jms_In_RS_execute_ppt"/>
<service-endpoint-interface>javax.xml.rpc.Service</service-endpoint-interface>
<call-property>
<name>javax.xml.rpc.service.endpoint.address</name>
<value>http://on-poc62.ontw.alfa.local:7777/event/PilotOWSM/MustHavesScenario5/MHS5_Jms_In_RS</value>
</call-property>
<call-property>
<name>javax.xml.rpc.soap.http.soapaction.uri</name>
<value>execute</value>
</call-property>
<call-property>
<name>javax.xml.rpc.soap.http.soapaction.use</name>
<value>true</value>
</call-property>
<call-property>
<name>javax.xml.rpc.soap.operation.style</name>
<value>document</value>
</call-property>
<runtime enabled="owsm">
<owsm init-home="/oracle/product/SoaAs/10.1.3/owsm/config/interceptors/C0003002"
init-file="confluent.properties"/>
</runtime>
</port-info>
</service-ref-mapping>
</entity-deployment>
<message-driven-deployment name="MDBEjbMecomsIFS"
resource-adapter="OEMSJMSDRAopp-ifs"
enabled="true" max-instances="10">
<!--
The ejb requires a connection factory implementing the "javax.jms.XAConnectionFactory"
interface to be accessible at jndi location "java:comp/env/jms/QueueConnectionFactory". (see ejb-jar.xml and ....)
A suitable connection factory is already accessible at jndi location "OEMSJMSDRASubcontext/MyXACF" (see oc4j-ra.xml)
-->
<resource-ref-mapping location="OEMSJMSDRASubopp-ifs/MyXACF"
name="jms/QueueConnectionFactory"/>
<!-- don't misspell this or you'll get an RP CF which doesn't work -->
<!-- Required activation-spec properties. -->
<!--
ConnectionFactoryJndiName (string, no default)
This should be the JNDI location of an RA connection factory.
The JMS Connector will use this connection factory to create the JMS
connection it uses to receive messages for this MDB's onMessage. If the
exception queue is enabled (see UseExceptionQueue), the JMS Connector will
also use a connection created from this connection factory for the production
of messages to the exception queue.
This connection factory must be compatible with the message domain(s). (For
example, if the MDB is receiving messages from a queue, the connection
factory should implement javax.jms.[XA]QueueConnectionFactory or
javx.jms.[XA]ConnectionFactory.)
For XA/non-XA considerations, see the <container-transaction> comments later
in this file.
-->
<config-property>
<config-property-name>ConnectionFactoryJndiName</config-property-name>
<config-property-value>OEMSJMSDRASubopp-ifs/MyXAQCF</config-property-value>
</config-property>
<!--
DestinationName (string, no default)
This is JNDI location of the queue or topic from which messages to be
delivered to the MDB's onMessage method should be received.
The JNDI locations for RA destinations are defined in the
oc4j-connectors.xml file.
-->
<config-property>
<config-property-name>DestinationName</config-property-name>
<config-property-value>OEMSJMSDRASubopp-ifs/MyQ</config-property-value>
</config-property>
<!--
DestinationType (string, no default)
This must be set to the type of the destination named by the above
"DestinationName" property.
The EJB 2.1 spec states that this must be set to either javax.jms.Queue or
javax.jms.Topic. OracleGJRA also allows it to be set to
javax.jms.Destination (which works for both queues and topics).
-->
<config-property>
<config-property-name>DestinationType</config-property-name>
<config-property-value>javax.jms.Queue</config-property-value>
</config-property>
<!--
Other activation-spec properties.
The following activation-spec properties supported by OracleGJRA are optional
except where otherwise noted:
-->
<!--
ListenerThreadMaxPollInterval (milliseconds, 5000)
Listener threads "poll" to see if there is a message waiting to be processed.
The more frequently this polling is performed, the faster (on average) a given
listener thread can respond to a new message. The price for frequent polling is
overhead - the resource provider must process a receive request each time it is
polled.
Oracle's JMS Connector implementation applies an adaptive algorithm which
uses shorter polling intervals (high polling rates) during periods of activity
(once activity is noticed) and longer polling intervals (lower polling rates)
during periods of inactivity. The ListenerThreadMaxPollInterval property places
an upper limit on the polling interval used by this adaptive algorithm.
-->
<config-property>
<config-property-name>ListenerThreadMaxPollInterval</config-property-name>
<config-property-value>5000</config-property-value>
</config-property>
<!--
AcknowledgeMode (string, default = Auto-acknowledge)
This should be set to Auto-acknowledge or Dups-ok-acknowledge. This
controls the quality-of-service provided by listener threads which
consume messages and call the MDB's onMessage method.
MessageSelector (string, default = no message filtering)
This is the selector expression used to filter messages sent to the
MDB's onMessage method. (I.e., this is used as the messageSelector for
the JMS sessions created for the listener threads.)
SubscriptionDurability (string, default = NonDurable)
For topics this should be set to Durable or NonDurable. (This should
not be set for queues.) This controls the durability of the topic
consumer used by the listener thread. When SubscriptionDurability is
set to Durable (and DestinationType is javax.jms.Topic or
javax.jms.Destination), the SubscriptionName property is required.
SubscriptionName (string, no default)
This property is required when SubscriptionDurability is Durable (and
DestinationType is javax.jms.Topic or javax.jms.Destination). (In all
other cases it is ignored.) This is the name used when creating the
durable subscriber used by the listener thread. For a given JMS server,
a given subscription name should be assigned to at most one MDB (which
must have most one listener thread).
ClientId (string, no default)
If set, connection(s) used by the listener threads will be set to use
this client ID.
TransactionTimeout (milliseconds, default = 300,000)
This limits the amount of time that the JMS Connector will wait for a
message to arrive before exiting the current transaction. The
transaction manager limits the amount of time a transaction can last
(see transaction-timeout in transaction-manager.xml).
TransactionTimeout should be set such that the transaction manager will
not timeout the transaction during the onMessage routine unless
something is wrong. For example, If the transaction mananager timeout
is set to 30 seconds, and the onMessage routine will never take more
than 10 seconds unless something is wrong, then this property could be
set to 20 seconds (20000 milliseconds).
EndpointFailureRetryInterval (milliseconds, default = 60,000)
If an endpoint can not be processed (due to the app server WorkManager
not accepting new work), it will be scheduled to be retried this many
milliseconds later.
ReceiverThreads (integer, default = 1)
This sets the maximum number of listener threads to create for this
endpoint. For queues, using more than one thread may be useful in
increasing the rate at which messages can be consumed. For topics this
value should always be 1. (Each listener thread gets its own session
and TopicSubscriber. For durable subscribers it would be an error to
have more than one subscriber with the same subscription name. For
nondurable subscribers having more than one thread will not help because
more threads translates into more subscribers which translates into more
copies of each message.) See also: ListenerThreadMinBusyDuration
UseExceptionQueue (boolean, default = false)
When "UseExceptionQueue" is true:
- Messages that would otherwise be discarded are sent to the
exception queue. (Currently the only case where this happens is
when the max delivery count is exceeded. See MaxDeliveryCnt
property.) Rather than sending the original message directly to
the exception queue, the following procedure is used:
o Create a new message of the same type.
o Copy the properties and body from the original message to the
new message.
o If the headers were copied, sending the message to the
exception queue would cause most of them to be lost
(over-written by the resource-provider). So instead,
translate headers in the original to properties in the copy,
assigning each header obtained via "getJMS{Header}" to
property "GJRA_CopyOfJMS{Header}". Since
javax.jms.Destination is not a valid property type, translate
destination headers into descriptive messages.
(Currently this same service is not provided for JMSX*
properties, most notably the JMSXDeliveryCount property.)
o If some part of the copy process (above) or augmentation
process (below) fails, do not abort. Attempt to complete the
rest of the procedure. (For Bytes/Map/Stream message types,
this can mean that part of the body is copied and the rest is
not.)
o If the copy process is 100% successful, add a boolean property
called "GJRA_CopySuccessful" with the value "true".
o Add a string property called "GJRA_DeliveryFailureReason" which
indicates why the message was not delivered.
o If the MDB onMessage method generated an exception immediately
prior to the delivery failure, add a string property called
"GJRA_onMessageExceptions" which contains exception information.
o Send the resulting message to the exception queue.
Note that only one attempt is made to send the message to the
exception queue. Should this attempt fail, the message will
be discarded without being placed in the exception queue.
See IncludeBodiesInExceptionQueue property for potential variations
of the above procedure.
- The ExceptionQueueName property is required.
- In addition to being used for the primary destination, the
connection factory specified by the ConnectionFactoryJndiName
property will also be used for the exception queue. If the primary
destination (specified by the DestinationName property) is a topic,
then the connection factory must support both queues and topics.
(I.e., the <connectionfactory-interface> [see oc4j-ra.xml] for the
given connection factory must be either javax.jms.ConnectionFactory
or javax.jms.XAConnectionFactory.)
ExceptionQueueName (string, no default)
This is the JNDI location of the javax.jms.Queue object to use as the
exception queue. (See UseExceptionQueue property for information about
the use of the exception queue.) This property is required when
UseExceptionQueue is true, and ignored when UseExceptionQueue is false.
IncludeBodiesInExceptionQueue (boolean, default = true)
This controls whether or not messages sent to the exception queue will
include a message body. (See UseExceptionQueue property for information
about the use of the exception queue.) If many messages are sent to the
exception queue during normal operation and the message body is of no
use in the exception queue, then this property may be set false to
improve performance. This property is ignored when UseExceptionQueue is
false. There are two cases where this property does not apply:
- If the original message did not have a message body, then the
message sent to the exception queue will not have one either.
- If a copy of the original message can not be created for any
reason, then the original may be sent to the exception queue
instead. This may result in a message body being sent to the
exception queue.
MaxDeliveryCnt (integer, default = 5)
If a message has the "JMSXDeliveryCount" property and the value of that
property is greater than MaxDeliveryCnt, then the message will be
discarded (and not sent to onMessage). If the exception queue is
enabled (see UseExceptionQueue), a copy of the message will be sent to
the exception queue. If MaxDeliveryCnt is set to 0, no messages will be
discarded. (Note that when an MDB responds to a message by throwing an
exception, the message is not considered delivered and it may be
redelivered. If the MDB might always respond to a given message by
throwing an exception, and MaxDeliveryCnt is set to 0 to prevent the
message from ever being discarded, the result may be an MDB stuck in an
"infinite loop" - failing to process the same message over and over
again.)
-->
<config-property>
<config-property-name>MaxDeliveryCnt</config-property-name>
<config-property-value>0</config-property-value>
</config-property>
<!--
LogLevel (string, no default)
This controls the level of detail of messages logged by the JMS
Connector. These messages are primarily intended for debugging the
JMS Connector itself, but may also be useful when debugging issues
related to the use of the JMS Connector. This property should not be
set in production code. (It should only be set temporarily for
debugging purposes - specific log messages and log levels may be and
will be added/removed/modified in future versions of the JMS
Connector.) Currently the allowed values are:
ConnectionPool
ConnectionOps
TransactionalOps
ListenerThreads
INFO
CONFIG
FINE
FINER
FINEST
SEVERE
WARNING
OFF
ListenerThreadMaxIdleDuration (milliseconds, default = 300,000)
This is how long a listener thread which is not receiving any messages
will be kept around. (At least one listener thread will remain as long
as the endpoint is active.)
ListenerThreadMinBusyDuration (milliseconds, default = 10,000)
If a listener thread has just received a message, has not been idle (had to
wait for a new message to arrive) at any point during the past
ListenerThreadMinBusyDuration milliseconds, and the current number of
listener threads for this endpoint is less than ReceiverThreads, then
(application server willing) an additional listener thread will be created.
ResUser (string, default = null)
ResPassword (string, default = null)
These properties allow a user/password to be passed to the resource
provider. When neither of these properties are set, connections used for
this MDB's inbound message handling (as well as for exception queue
handling, if enabled) are created using the no-argument version of the
create*Connection method. When one or both of these properties are set,
they are passed to the create*Connection method as the user/password
arguments. (If only one property is not set, then 'null' is used for that
particular create*Connection argument.) The ResPassword property supports
the standard password indirection options (e.g., using "->joeuser" to
represent the password of "joeuser").
Note that the commas used in many of the above default values and examples are
included here for readability but can not be used in the actual activation spec.
(I.e., integer/milliseconds values in the activation spec must not include
embedded commas.)
-->
</message-driven-deployment>
</enterprise-beans>
<assembly-descriptor>
<default-method-access>
<security-role-mapping name="<default-ejb-caller-role>"
impliesAll="true"/>
</default-method-access>
</assembly-descriptor>
</orion-ejb-jar> -
How to call a text FTP proxy service from a Java client ?
Greetings,
I've configured a text FTP proxy service which downloads files from a FTP server. It pols a directory on the FTP server and, as soon as a file respecting a given pattern apears it is downloaded. I tested the service in the test console and by putting some test files onto the FTP server. Now, I need to be able to test it from a Java client. How may I do that ? I need to write a Java client to connect to the OSB and to tell to it to use the FTP proxy in order to download a given file, from a given location and to put it in a given location on the client machine. Many thanks in advance for any help. A sample would be great !
Kind regards,
NicolasOk, I understand. The crucial question here is "what is a caller that you refer to?"
Don't get me wrong, but the problem here is that you probably don't understand, what OSB is good for. OSB is an event-driven system. The event in your case is a new message in remote FTP server. You have to define what should happen when that event is fired. And that's all. You don't have to involve other client (or caller) for this case.
You should define your FTP proxy to retrieve all relevant files from FTP server and then you should route them based on their name/content/encoding/whatever to different consumers. You can also have many proxies if you want - one for each name. It's up to you. But you don't have any "callers" in either case. -
How can I call a plsql function from an attribute?
I have an attribute defined in an element. I want execute a PLSQL function from the attribute, and display the returne value with an HTML template.
I've defined the attribute's type like PLSQL, and I've put the called of the function in the value of the attribute, but it doesn't work. The only value I obtain is an URL (I think that is the URL of the function or someting like this).
How can I call to my function from the attribute and display the returnes value in the page?
Thanks.Thanks, but it doesn't work. I have an attribute called ID_BOL and I want to associate a sequence to that attribute. I've created a function, with the sequence. This function return de value of the sequence. I want taht the attribute takes the value of the sequenece dinamically.
I've tried it, creating the type attribute like PLSQL, and calling the function from the attribute, but it doesn't work.
How can I return the sequence value to my attribute?
Thanks. -
Can any one tell me how can i call a shell script from pl/sql
i like to call shell script from pl/sql procedure.
can any one suggest how can i do thisHave you not mastered in asking the same kind of question ?
First do write a script...
no one will spoon feed you.
How can i call a shell script from procedure
How to call Shell Script from pl/sql block
-Sk -
How can i call a shell script from procedure
I have a shell script.now i am i a situation to call that shell script from one of my procedures and need to get a value from that script.
can u suggest me that how can a call the shell script from pl/sql?Is the same question you asked here
How to call Shell Script from pl/sql block
-SK -
How to call a .jar file from a java bean?
any body knows how to call a .jar file from a java bean?
Crosspost!
http://forum.java.sun.com/thread.jspa?messageID=4349619
Maybe you are looking for
-
Phone does not ring when I get calls
My phone does not ring when I receive incoming calls since I upgraded software to IOS 7.
-
*.MTS Video format needed
Hei. I really need *.MTS video format support for Adobe Revel. Allmost all my video in last 10 years are *.MTS It's not nice convert them all to "eatable" format for Adobe Revel. I really count on Adobe.
-
All buttons lock up and do not respond
I am developing a tabbed-dialog box with multiple tabs. The piece is a single movie clip in a larger application, with different frames containing the graphic backgrounds for each tab. Textfields are placed on the backgrounds dynamically when the swf
-
Error when Trying to Run Concurrent Request on ASCP Instance
Hi Experts, I have an issue when trying to run custom concurrent program in ASCP production. The error message is: oracle error 20001 ORA-20001: APP-FND-02901 You do not have access privilege to any operating unit. Please check if your profile option
-
hI...friends, we r doing B2B scenarios. i want to connect to the client system through URL, at sender side we r having sap system , target side we r having webserver system. both sides are synchronous purpose. in this we want to maintain the digital