Transaction propagation from my EJB to a SOA server
Hi,
I am developing ejb Stateless wich need to invoke bpel process. To comunicates from my EJB to SOA I'm using Worklist API an EM API.My SOA server is given me a Out Of Memory and I have seen into diagosis file that my EJB statless Trasaccitóns are trasmited to SOA Server, Is it a normal behaviour? How can avoid a Transactión trasmision?
Thaks.
Hi,
You must analyze inside the Worklist API and your SOA Server.
Which SOA Server are using ?
Which JVM configurations are you using to start the SOA server and Container Server ?
How much free memory has your machine with started JVM and while running the code section ?
If everything above going well and if OutOfMemory happen inside your application, you should try Weak and Soft Reference (Be careful with your development while coding).
Similar Messages
-
Calling EJB from other EJB on other J2EE Server
Can I call EJB from other EJB on other J2EE Server
Servers - Websphere 5.0
Do i require home & remote interface of that ejb on client side also
Help me, pleasethe problem is actually i require that is specific to websphere
for example i want to call a method ion that ejb
say my ejb name is myejb
so the normal way i should call is
InitialContext initialContext = new InitialContext();
Object homeObject = initialContext.lookup("ejb/MyEjbHome");
MyEJBHome myEJBHome =(MYEjbHome )javax.rmi.PortableRemoteObject.narrow(homeObjectMYEjbHome.class);
myEJB = lSHome.create();
myEJB.someMethod();
but here i am having class for home and remote available
now if other app server i am not having this classes then what to do -
Calling EJBs from other EJBs in other J2EE Server?
How can I call one EJB on one J2EE Server from other
EJB on other J2EE Server?
Help me, please.
Dmitry TumanovBasically call the beans as if you were calling them in the same server through their remote interfaces. Get a InitialContext into the other appserver and then get the home object, narrow it and create a remote reference. You can follow the standard implementation just make sure that the InitialContext you create has the right properties, ie. context factory, urls, etc to the OTHER appserver.
-
Transaction propagation from Oracle 8i or 9i to OC4J V2?
We have a very large Oracle 8i (8.1.6)-based application that uses PL/SQL exclusively for business logic; there are a few hundred user packages. We are considering a gradual introduction of EJB's into the mix, most likely via OC4J V2 when it is released.
Issue:
Because of the significant legacy of PL/SQL, it will be necessary to NOT ONLY be able to invoke PL/SQL and SQL from the EJB residing in the app server in a global transaction, BUT ALSO go the other direction: have a PL/SQL proc/function call out to an EJB in the app server. I theorize we can do this by setting up Java Stored Procedures that act as a facade for invoking EJB methods.
Scenario:
Oracle Forms web client invokes PL/SQL stored procedure, which invokes Java stored procedure, which looks up and invokes an EJB (EJB spec 2.0) in the app server, which invokes PL/SQL stored procedure or just plain SQL via JDBC.
Forms client -> PL/SQL SP -> Java SP -> EJB (on separate app server) -> PL/SQL or SQL.
Questions:
1) Assuming using OC4J V2 as the app server and Oracle 8.1.6 as database at both ends, will a transaction begun with the client (e.g. Forms 6i) propagate to all tiers of the call chain above? If not, why?
2) If it does work, is there anything special that must be coded in the Java stored proc, e.g. anything special usage of JTA?
3) Will it work the same in Oracle 8.1.6 and Oracle 9i?
4) Are there any problems using J2EE 1.3 API's from within Java stored procedures, given that Oracle 8i and 9i have backlevel built-in support for many of these features? In particular, I understand JServer has EJB 1.1 builtin, but what if I want to use an EJB 2.0 running in an external app server?
5) Are there any JTA incompatibilities between 8i/9i and J2EE 1.3 implementations (e.g. OC4J V2), particularly that would hamper this scenario?
6) If all is good so far, could I expect to replace OC4J with another J2EE 1.3 compliant app server (e.g. WebLogic or WebSphere) and still have same results?
7) Is it necessary to setup 2-phase commit in Oracle if the both the client-invoked and EJB-invoked databases in the above example are the same Oracle instance?Hi Scott,
Answers appear below your questions...
Questions:
1) Assuming using OC4J V2 as the app server and Oracle 8.1.6 as database at both ends, will a transaction begun with the client (e.g. Forms 6i) propagate to all tiers of the call chain above? If not, why?Client side transactions are not supported (as far as I know), so
the answer is "no" and the reason is "not supported".
2) If it does work, is there anything special that must be coded in the Java stored proc, e.g. anything special usage of JTA?Irrelevant, since client-side transactions aren't supported.
3) Will it work the same in Oracle 8.1.6 and Oracle 9i?Yes, since neither 8i or 9i support client-side transactions.
Besides (again, as far as I know), both 8i and 9i both have the
same embedded JVM.
4) Are there any problems using J2EE 1.3 API's from within Java stored procedures, given that Oracle 8i and 9i have backlevel built-in support for many of these features? In particular, I understand JServer has EJB 1.1 builtin, but what if I want to use an EJB 2.0 running in an external app server? The database (8i and 9i) EJB container is not the same as OC4J. In
fact (as far as I know), Oracle recommends NOT using the embedded
container and using OC4J only. This means that in order for a java
stored procedure to lookup an OC4J EJB, you need to load the OC4J
JAR files into the database (via the "loadjava" tool). I haven't
tried it, but someone else posted to the forum saying he would try
it -- but I don't know how his experiment turned out. However, as
a workaround, you can use RMI in a java stored procedure. I have
successfully done this.
5) Are there any JTA incompatibilities between 8i/9i and J2EE 1.3 implementations (e.g. OC4J V2), particularly that would hamper this scenario?I don't know how to answer this question, sorry.
6) If all is good so far, could I expect to replace OC4J with another J2EE 1.3 compliant app server (e.g. WebLogic or WebSphere) and still have same results?Theoretically, J2EE compliant applications should be able to be
deployed and executed in any J2EE compliant application server.
However, another person in this forum had some difficulties in
migrating a ready built application from weblogic (I believe) to
OC4J. I think the problems were due to the application server
specific configuration differences (but I'm not sure).
7) Is it necessary to setup 2-phase commit in Oracle if the both the client-invoked and EJB-invoked databases in the above example are the same Oracle instance? I'm not sure about the status of two-phase commit support in OC4J.
Again, there is a (still unresolved, I think) thread in this forum
about some buggy commit behavious for CMP entity beans. However,
if you're asking this in the context of your scenarion (involving
client-side transactions), then it is moot, since, as I said earlier,
client side transactions are unsupported.
Hope this will help you,
Avi. -
Problems servicing EJB requests on SOA server. SOA Suite 11g.
Hi all
I recently installed SOA Suite 11g on my Windows 7 machine for a project that will be employing SOA, BPM and EJB services. I created a new SOA domain with an admin server and a managed SOA server. When creating the domain, I specified BPM Suite, SOA Suite, Enterprise manager, WSM Policy Manager and JRF to be included as per project requirements.
SOA and BPM project have been deployed to and are working fine on the SOA server, but I observed the following odd behaviour when I tried to deploy and use a Java EJB service: -
1. Via the admin console, I successfully deployed my EJB ear to the managed SOA server and can see it in the JNDI tree of the server.
2. When I try to invoke the EJB from a remote client, the service is successfully located via JNDI and a request is sent, but it is as though the service then simply swallows the request and does nothing with it. No output is returned from the EJB service and none of the logging from the EJB service appears in the logs. No errors are reported on the console or in any of the Weblogic logs that I have looked through.
3. I tried deploying the ear to the admin server instead and invoking it with the same client. This time it works absolutely fine.
4. When messing around with setDomainEnv.cmd, I accidentally removed jrf.jar from the classpath. When the SOA server subsequently started, this caused lots of errors while deploying the SOA components, but my EJB service worked with no problems on the SOA server. When I correcteed the classpath and restarted, the original problem returned.
It seems as though a conflict is occurring, which I am pretty baffled by. I would be very grateful for any advice or suggestions on this issue.
Many thanks
JonHi Jon
I don't know the root cause of this issue. But try this and see if it works. Undeploy this EJB EAR application from weblogic admin console. Then Login into EM Console. And in EM Console, expand weblogic domain and select your soa server under this folder and right click and try to Deploy your EAR. And then access the EJB.
We have some BPM Applications where we have one Workflow project that we deploy from EM Console. This BPM App also have lots of EJB projects. We deploy all of them as single EAR from em console under weblogic domain. So far we have not faced any issues.
Thanks
Ravi Jegga -
Implicit context propagation from JSP/EJB to RMI over IIOP?
Is there a way to implicitly send information, such as a UID, over IIOP. We
don't want/need the overhead of transactions but would like to embed this
UID in all threads from where they started...through to other VMs on other
hosts. This is to be used for monitoring the application.
Any help would be greatly appreciated!!
ShaneShane wrote:
Does this get propagated to RMI servers as well...not just from EJB to EJB??Yes.
>
And, does using SSL create much extra overhead?Yes.
>
>
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]..
In WLS 6.0, you can use SSL. With SSL, the identity of the caller ispropagated along with the request.
Shane wrote:
Is there a way to implicitly send information, such as a UID, over IIOP.
We
don't want/need the overhead of transactions but would like to embedthis
UID in all threads from where they started...through to other VMs onother
hosts. This is to be used for monitoring the application.
Any help would be greatly appreciated!!
Shane -
Can we have a transaction propagated to two ejb's in different machines if we have database interaction in both?
I tested it out with Account beans (examples)
deployed on two different(remote) servers both servers having the same connection pool name and the mapping to the
same oracle database (Using the oracle thin driver as well as the Weblogic Driver). One of the beans is in a local server and one in a remote server and both are accessed in the
same transaction context. What happens is that the 2nd bean accessed throws a Null pointer Exception
when it tries to getConnection().
This is the server side stack trace -----
SQLException: java.sql.SQLException: java.lang.NullPointerException:
Start server side stack trace:
java.lang.NullPointerException
at weblogic.jdbc.common.internal.ConnectionMOWrapper.<init>(ConnectionMO
Wrapper.java:42)
at weblogic.jdbc.common.internal.ConnectionEnv.setConnection(ConnectionE
nv.java:142)
at weblogic.jdbc.common.internal.DriverProxy.execute(DriverProxy.java:17
3)
at weblogic.t3.srvr.ClientRequest.execute(ClientContext.java:1030)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
End server side stack trace
It appears that when the database call on the 2nd WL server is routed to the first WL server(the server that established the first connection for the transaction) for the database connection it is not able to find the connection( and hence the bombing). I'm going nuts over this for two days. Please help. We need to use Weblogic for our project and i need to confirm that this functionality works!!!!
I'm attaching the stateless bean code which accesses both these beans.
[TraderBean.java]
Hi,
Are you using cluster?
Definitely you can be in one transaction if you just access one data source. that's two phase transaction.
"kartik" <[email protected]> wrote:
>
>
>
>Can we have a transaction propagated to two ejb's in different machines if we have database interaction in both?
>
>I tested it out with Account beans (examples)
> deployed on two different(remote) servers both servers having the same connection pool name and the mapping to the
> same oracle database (Using the oracle thin driver as well as the Weblogic Driver). One of the beans is in a local server and one in a remote server and both are accessed in the
> same transaction context. What happens is that the 2nd bean accessed throws a Null pointer Exception
> when it tries to getConnection().
>
>This is the server side stack trace -----
>SQLException: java.sql.SQLException: java.lang.NullPointerException:
>Start server side stack trace:
>java.lang.NullPointerException
> at weblogic.jdbc.common.internal.ConnectionMOWrapper.<init>(ConnectionMO
>Wrapper.java:42)
> at weblogic.jdbc.common.internal.ConnectionEnv.setConnection(ConnectionE
>nv.java:142)
> at weblogic.jdbc.common.internal.DriverProxy.execute(DriverProxy.java:17
>3)
> at weblogic.t3.srvr.ClientRequest.execute(ClientContext.java:1030)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
>End server side stack trace
>-----------------
>
>It appears that when the database call on the 2nd WL server is routed to the first WL server(the server that established the first connection for the transaction) for the database connection it is not able to find the connection( and hence the bombing). I'm going nuts over this for two days. Please help. We need to use Weblogic for our project and i need to confirm that this functionality works!!!!
>
>I'm attaching the stateless bean code which accesses both these beans.
>
-
Can I just confirm that if a method in an EJB has a JTA transactional context specified
by container-managed transaction demarcation, then the transaction context will be
propagated to any method that it calls in any other Java class. I just wanted to
be sure because we have all our SQL handling in separate Data Access classes whose
methods are called from the EJBs.
Thanks
Yes. Make sure that you are using a Transactional DataSource or the WebLogic JTS Driver to
access the connection pool...
Dave wrote:
> Can I just confirm that if a method in an EJB has a JTA transactional context specified
> by container-managed transaction demarcation, then the transaction context will be
> propagated to any method that it calls in any other Java class. I just wanted to
> be sure because we have all our SQL handling in separate Data Access classes whose
> methods are called from the EJBs.
> Thanks
-
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> -
EJB lookup from another EJB server
Hi people,
I have two application servers on two different computers. One
of them contains an EJB, which I need to access from another EJB
server. I know that I can achieve this using RMI, but will then
security and transaction contexts be propagated to the called
EJB?
Sincerely,
Sergei Batiuk.Here is the solution posted on another forum:
[email protected] Dec 8, 6:03 am show options
Newsgroups: ibm.software.websphere.studio
From: [email protected]
Date: 8 Dec 2004 06:03:04 -0800
Local: Wed, Dec 8 2004 6:03 am
Subject: Re: EJB lookup on from one server to another does not work
Eric,
I dealt with this same problem trying to run 2 local servers (websphere
test servers), using 2 separate WSAD 5.1.2 workspaces. Running on 1
server I have an application that contains an EJB, and running on the
other server is an application that uses an access bean to make a
remote call to my EJB, running on my other server. I too repeately
received the "NameNotFoundException" when trying to lookup my EJB home
reference.
What you have to do to get around this is to modify the server
configuration of the application that contains the EJB that you are
attempting to call remotely. You must open the the server.wsi file for
the server that is running the EJB and go to the "Configuration" tab.
You must check the "Enable administrative console". Once this is
complete, start your server. When it is started, right click on the
server, and select "run administrative console". In the admin console,
select
servers -> application servers -> <your server> -> end points ->
bootstrap address. For "host" you must change "localhost" to either
your ip address or computer name (ive only tried my ip, but your
computer name should work too). When building your properties to get
the initial context, make sure you use
"env.put(Context.PROVIDER_URL, "corbaloc:iiop:<the ip or computer name
listed as the bootstrap host of server running ejb>:<the port listed as
the bootstrap port of server running ejb, which is 2809 in your case>
Restart your server and things should work. -
Caller id propagation from WebLogic Express to WebLogic Server
Hi all,
I'm planning on a WebLogic configuration where Servlets executing in
WebLogic Express invoke EJBs executing in WebLogic Server. The Web container
and the EJB container are thus executing in different processes.
Given that a user is authenticated in WebLogic Express using e.g. the
J2EE-standard form-based authentication, would the user id be propagated to
the EJB container automatically?
Thanks
Patrik Gottfridsson
ValtechCall flow was :
CUCM---Router-----MPLS----Router---CME
extension 1040 from cucm was calling extension 2800 on CME, and on the display from the phone that is registered on CME had the "UNKNOWN" on it.
But I just figured it out.
Thanks anyways! -
Transaction Isolation Level for EJB methods
L.S.
I just found out the in OC4J one can not set the transaction isolation level on ejb methods. Moreover one needs to revert to bean managed transaction (manual coding of the ALL transaction logic) to set the isolation level.
On entity beans one can only set the isolation level for the whole bean (not on individual methods), and in session beans there is no way at all to set the isolation level.
This is on shear contract to all other application servers I used before (there one can declaratively set the isolation level for a ejb method, both in session and in entitybean deployment descriptors)
Is it foreseen in a future release to include such a valuable feature will be provided by oc4j?
Note that I was VERY surprised that OC4J could not handle this (I checked the j2ee spec, but admittedly the spec is a little vague about this support and makes it vendor dependent. the j2ee spec does not mandate this, except for CMP entity beans, but includes some suggestions on this ability. But most other application servers implemented the ability)
Regadrs,
ErikHello Erik --
I think we met in Perth recently?
Anyway, your information is correct.
We can set the transaction isolation level for each entity bean, at the bean level. We don't have for the specification of method level isolation settings -- I'd be interested to hear how you would like/do use this. What behaviour do you expect to see when a transaction is started that spans multiple methods on a bean with different declared isolation levels.
For session beans, we do not currently have the ability to declaratively specify the isolation level to use for the bean. I know this is not in the forthcoming 904 release, and will to check what is beyond that.
As you point out, this can be done programatically using the Connection.setIsolationLevel() method on any connections you are using from within the session bean.
I'd would like to log an enhancement request for you for this functionality. Can you send me an email at [email protected] and we'll take it offline.
-steve- -
Got javax.transaction.HeuristicMixedException when calling EJB business methods
I have developed two EJBs. One is a stateless session bean,
called InventorySessionBean(JNDI name: Inventory); the other one
is a CMP Entity Bean called InventoryBean(JNDI name:
InventoryBean). The InventoryBean represents the business object
of Inventory. InventoryBean is declared CMT and all methods in
the beans have attribute "Required". The InventorySessionBean is a session facade
which encapsulate the business methods of
InventoryBean. InventorySessionBean is declared CMT and all
methods in the bean have attribute"RequiresNew" The backend
database is Ingres.
I have setup JDBC connection pool, Datasource and Tx Datasource.
There is a client program which invokes InventorySessionBean to get business data
from database.
Actually the InventorySessionBean invokes InventoryBean entity bean to get data
from database.
After I starting up the weblogic server, I ran the client program to get data,
everything works fine.
After a period of time (about 50 minutes ) from starting the WLS server, I reran
the client program.
I got following exceptions:
Exception while commiting Tx : Name=[EJB com.memec.na.mppl.businessobjects.inventory.InventorySessionBean.getPriceAndAvailability(java.lang.String,ja
va.lang.String,java.lang.String,java.lang.String)],Xid=4:916d7da2142a593c(2094524),Status=Committed,HeuristicErrorCode=XA_HEURHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
since begin=3,seconds left=119,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=committed,assigned=leiWLS),SCInfo
[leiwang+leiWLS]=(state=committed),properties=({weblogic.transaction.name=[EJBcom.memec.na.mppl.businessobjects.inventory.InventorySessionBean.getPriceAndAvailability(java.lang.String,java.lang.String,java.lang.String,java.lang.String)],
weblogic.jdbc=t3://10.1.129.124:7001}),OwnerTransactionManage
r=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=leiWLS+10.1.129.124:7001+leiwang+,
Resources={})],CoordinatorURL=leiWLS+10.1.129.124:7001+leiwa
ng+); nested exception is:
javax.transaction.HeuristicMixedException: (weblogic.jdbc.jts.Connection,
HeuristicHazard, (javax.transaction.xa.XAException: Error dequeueing
message for statement connection # 23 type S))
java.rmi.RemoteException: Exception while commiting Tx : Name=[EJB com.memec.na.mppl.businessobjects.inventory.InventorySessionBean.getPriceAndAvailab
ility(java.lang.String,java.lang.String,java.lang.String,java.lang.String)],Xid=4:916d7da2142a593c(2094524),Status=Committed,HeuristicErrorCode=XA_HEU
RHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=3,seconds left=119,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=committe
d,assigned=leiWLS),SCInfo[leiwang+leiWLS]=(state=committed),properties=({weblogic.transaction.name=[EJB
com.memec.na.mppl.businessobjects.inventory.In
ventorySessionBean.getPriceAndAvailability(java.lang.String,java.lang.String,java.lang.String,java.lang.String)],
weblogic.jdbc=t3://10.1.129.124:7001
}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=leiWLS+10.1.129.124:7001+leiwang+,
Resources={})],CoordinatorURL=leiWL
S+10.1.129.124:7001+leiwang+); nested exception is:
javax.transaction.HeuristicMixedException: (weblogic.jdbc.jts.Connection,
HeuristicHazard, (javax.transaction.xa.XAException: Error dequeueing
message for statement connection # 23 type S))
javax.transaction.HeuristicMixedException: (weblogic.jdbc.jts.Connection, HeuristicHazard,
(javax.transaction.xa.XAException: Error dequeueing message
for statement connection # 23 type S))
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:237)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:231)
at com.memec.na.mppl.businessobjects.inventory.InventorySessionBean_9wgxw_EOImpl.getPriceAndAvailability(InventorySessionBean_9wgxw_EOImpl.jav
a:224)
at com.memec.na.mppl.processors.Outbound3A2Processor.getData(Outbound3A2Processor.java:202)
Stop the WLS server and restart it again. Everything works well.
Any comments to this problem would be really appreciated. Thanks.
Hi
I was using the session bean.Your suggestion helped me a lot.Perfect.
I debug my program and found that from ejbCreate()exception is getting.
I was getting the datasource object thro ejb create() initialisation.
Somehow the look up jndi which i mentioned was not interpretting from ejb-jar.xml ias-ejb-jar.xml and datasource ref .Due to this iam getting jndi Namenotfound exception which in turns to null pointer as datasource is getting null.
when i hardcoded in the ejb the the jndi name for datasource it is working fine.Bit worried all the existing ejbs working with the xml referenced datasource and jndi,but when i added a new ejb with same properties it is failing to get the jndi name.
Piece of code from ias-ejb-jar.xml
<resource-ref>
<res-ref-name>myDataSource</res-ref-name>
<jndi-name>jdbc/nb/myData</jndi-name>
</resource-ref>
Piece of code from ejb-jar.xml
<resource-ref>
<res-ref-name>myDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Thanks a lot meka -
Transaction propagation between OC4J to non-OC4J J2EE container
I have a OC4J instance 10.1.3.1 containing a stateless session EJB 2.1. This bean call another session EJB in Websphere EJB container. The call goes through but the transaction is not distributed, meaning I cannot roll the transaction back from the OC4J container.
I have tried all kinds of context factories but it doesen't work. I use a XA datasource to an Oracle DB from the Websphere container.
Does anyone know how to propagate transactions from an OC4J container to another J2EE container:
Thanks
regards
A BastellYou can specify the JNDI properties in your JSP/Java Client to lookup the EJB if it's in a different EJB container than the one provided by the JSP container.
Rob -
Transaction problems in Stateless EJB
I have problems as follows. my client is a servlet which call method B in stateless ejb, In side of method B, there is a loop from which antoher method C in this same ejb is called repeatedly. I want each call of method C being a separate transaction. I can not make this work. the final result will always be one transaction from for loop. I set the transaction attribute as Requires for method B, and Requires New for method C. Please offer some help.
Thanks.
void ejbMethodB(){
where(mycondition)
ejbMethodC()
I like to make each call of ejbMethodC be a standalone transaction instaed of the running results from the whole loop being a transactionFirst of all, thank you so much for your time.
I also doubt the problem is Resin. But "Required" attribut works fine. The following is the coding:
EJB implementation:
//mehtodB
public RequestResult getDailyCreateUpdateInfo(Request request)
throws RemoteException, ProcessException
boolean testFlag = false;
List resultList = null;
ClaimsDAO dao = null;
Map mapRequestData = getRequestData(request);
int num = 0;
InterfacePushProcess push_process = (InterfacePushProcessRemote)(mySessionCtx.getEJBLocalObject());
try {
//Call DAO and get Student, ExchangeVisitor and their dependent information
dao = (ClaimsDAO) getEntityObject(ClaimsDAO.class.getName());
dataPushBO = new ClaimsDataImpl(mapRequestData);
//get the list of categories for DOS or US-VISIT
interdataList = dataPushBO.createCategoryList();
Iterator iterator = interdataList.iterator();
System.out.println("before invokeTransacprocess. ");
//testing
this.invokeTransacProcess();
//process all the categories for DOS or US-VISIT
while(iterator.hasNext())
interconfigData = (InterfaceDataConfig) iterator.next();
processOneCategory(mapRequestData, interconfigData, dao);
} catch (Exception e) {
mySessionCtx.setRollbackOnly();
log.logp(Level.SEVERE, classname, "getDailyCreateUpdateInfo", e.getMessage());
Object[] args = createExceptionArgs();
args[0] = request.getName();
throw new ProcessException(IMessage.ENTITY_POPULATION_FAILED, args, e);
return new RequestResult(request, resultList);
//mehtodC
public void processOneCategory(Map reqmap, InterfaceDataConfig interconfigData, ClaimsDAO dao)
throws ProcessException
List pageList = null;
String fileType = interconfigData.getGroupName(); //student, dep etc
String countKey = interconfigData.getCountKey();
String logKey = interconfigData.getIDKey();
UserTransaction trans = null;
int count = 0;
boolean process = false;
String groupname = interconfigData.getGroupName();
log.logp(Level.INFO, classname, "processOneCategory() ", "group name = " + groupname);
try
Context ct = new InitialContext();
trans = (UserTransaction) ct.lookup("java:comp/UserTransaction");
trans.begin();
String startTime = convert.getTimestamp();
log.logp( Level.INFO, classname, "processOneCategory() ", "processing start time: "+startTime);
pageList = processOnePage(interconfigData, dao);
if (pageList.isEmpty())
log.info("There are no records which need be processed.");
else
do
try
this.displayResult(pageList);
process = pageOutputProcessor(reqmap, interconfigData, pageList);
pageList.clear();
pageList = this.processOnePage(interconfigData, dao);
} catch (Exception ex) {
mySessionCtx.setRollbackOnly();
String msg = "Error while processing one page : " + ex.getMessage();
log.logp(Level.SEVERE, classname, "processOneCategory() ", msg);
throw new ProcessException(msg);
} while (!pageList.isEmpty());
//testing separate transaction
if(groupname.equalsIgnoreCase("STUDENT"))
trans.commit();
else
trans.rollback();
} catch (Exception t) {
mySessionCtx.setRollbackOnly();
String m = "Error when processing results from ClaimsDAO's : " + t.getMessage();
log.logp(Level.SEVERE, classname, "processOneCategory() ", m);
throw new ProcessException(m);
} finally {
I put both methods: getDailyCreateUpdateInfo and processOneCategory in remote interface so I can use your suggested method to reference the EJB instance.
Servlet Client call "getDailyCreateUpdateInfo" method (the transaction attribute is Required) in which call processOneCategory(,,) method (transaction attribute is RequiresNew).
I put some testing code to see if I can achieve the separate transaction in each call of mehtod processOneCategory(,,) , it does not work. If I use Bean Managed Transaction, it works right away. My app. server is Resin 2.1.4.
Again, Thank you.
Mark
Maybe you are looking for
-
I tried to get an answer through the iTunes community, and was advised to try here instead as it didn't have anything directly to do with iTunes Not all iTunes Files not showing up on External HDD So in a nutshell, all of my 35'000 iTunes files (actu
-
I have a workflow that is reading images names & pathways from a text file, and copying the images in the text file into another folder. My problem is coming with the "Copy Finder Items" action. If I have the same image that I want copied into the fo
-
I'm evaluating Reports as one the final candidate report writers for integration with a new application. I have been reading much of the documentation on the product, but I still have a question: Is there any way to programmatically trigger a report
-
Can I sort a column in Numbers without affecting the associate rows?
I have a schedule with date columns and lists of names. I would like to sort the names alphabetically in each column, but the rows are tied to the column. Is there a way to sort each column without effecting the entire table?
-
Guyz, Could someone pls let me know the list of courses to be done for one to become a 'Development Consultant' in XI in UK pls? Thanks