J2EE / JMS Controlling transaction in util.jar
Hi all experts!
I've a delicate problem where I want to handle transactions transparently for EJBs in my util jar. I�m familiar with the other alternatives (MDBs etc) and using them in other parts of the solution but they can�t be used here (need a synchronous request-reply).
The description is a bit long but please bare with me, hopefully it is clear and understandable.
Summary:
Why can't I use a UserTransaction in a utility.jar when called from a EJB using container managed transaction.
Senario:
transport_util.jar:
Transport utility package contains no EJBs, just simple java classes (to make usage / deployment more simple for the users of the util.jar).
The EJBs use an ApplicationFacade in the transport_util.jar (not a EJB just a java class) providing a high level communication API for JMS transport, encapsuling JMS specific code, and providing the simple transport primitives:
- void send(Object data) : writing fire and forget messages to JMS Queue
- Object requestReply(Object data) : sending a request message and waiting
synchronously for a reply message. Not pretty when using messaging but
necessary in this solution.
AnyEJB.jar:
The �client� using the transport primitives in transport_util.jar. The transport_util.jar is included in the EAR application as a utility.jar. The EJBs can use either Container (CMT) or Bean Managed Transactions (BMT). The transport_util.jar shouldn�t set any limitations.
Problem:
The problem arise when a �client� EJB under CMT calls the requestReply function in the API. The message is written to the JMS Queue by the transport_util before it starts to listen for a reply, on a in Queue, which will be returned to the caller. The request message is nerver delivered to the recipient who there for won�t produce a reply.
Why? Because it is written to the JMS Queue inside a transaction (implicit from the calling EJB) which has not been committed (and shouldn�t from the clients perspective) before the API starts to listen for the reply. No delivery until commit! The transactional parameter isn�t valid when inside a application server
My idea of a solution:
Start a new UserTransaction, putTx, inside the requestReply function to halt the callers transaction (J2EE doesn�t support nested trans) and use it around the put operation. After a successful put the putTx could be committed, without affecting the callers transaction, which would lead to the message being sent to the recipient and finally a reply could arrive. Only one big problem.:
I get a naming exception when trying to lookup the UserTransaction through JNDI if the calling EJB use CMT but not if it uses BMT. Why? Is there a workaround?
InitialContext ctxt = new InitialContext();
UserTransaction putTx = ctxt.lookup(�java:comp/UserTransaction�)
putTx.begin();
// Put message on queue
putTx.commit();
// Try read reply from queue
Infrastructure:
- IBM WebSpehere Application Server 5
- IBM WebSpehere MQ 5.3
- Java 1.3
Exception excerpt:
Error occurred while handling transaction
[2003-09-04 17:06:47:479 CEST] 7f8389dc SystemOut O javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
[2003-09-04 17:06:47:479 CEST] 7f8389dc SystemOut O at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1003)
[2003-09-04 17:06:47:479 CEST] 7f8389dc SystemOut O at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1211)
[2003-09-04 17:06:47:479 CEST] 7f8389dc SystemOut O at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
[2003-09-04 17:06:47:479 CEST] 7f8389dc SystemOut O at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
[2003-09-04 17:06:47:479 CEST] 7f8389dc SystemOut O at javax.naming.InitialContext.lookup(InitialContext.java:359)
/Best regards
Jesper
If anyone else have the same problem....
After a great tip from a colleague a good solution if found!
By getting hold of the TransactionManger from the ApplicationServer it is possible to suspend an ongoing transaction, start a new one and commit it and restart the suspended transaction again.
Looking up the TransactionManger differs a lot from AppServer to AppServer. To find out how it is done on yours take a peak in the code of any of bigger persistence frameworks (I looked at Hibernate).
So in pseudo code:
// Error checks not in code to keep it short
// Look up the TransactionManager
TransactionManager mgrTx = //
// Suspend callers Tx
Transaction callerTx = mgrTx.suspend();
// Start new transaction for the work to be performed
// outside the callers transaction
mgrTx.begin();
// Perform transacted work .....
// Commit
mgrTx.commit();
// Reassign the callers transaction to the thread and activate if
mgrTx.resume(callerTx);/J
Similar Messages
-
Example of Weblogic Appserver using XA Controlled Transaction to send messages to third party JMS
I am looking for Example of Weblogic Appserver using XA Controlled Transaction
to send messages to third party JMS Server.
I want to send messages to JMS and use Weblogic MDB to consume that message and
send it to some third party JMS in a XA Controlled transaction.
Sure. Right now, it involves a bit of JTA programming -- in our next
release, it should be easier, however.
Before sending a message, you have to:
-- Use the TxHelper class to get the current Transaction object.
-- Use the "getXAResource" method on the JMS provider's Session object to
get the XAResource object for the JMS Session you're using to send.
-- Call "enlistResource" on the Transaction object.
You MUST do this in every transaction where you use the JMS provider to send
a message.
You can find the documentation for the TxHelper class and other
WebLogic-specific classes here:
http://e-docs.bea.com/wls/docs70/javadocs/index.html
Look for the "weblogic.transaction" package.
You can find documentation for the Transaction class (which defines
enlistResource) and other classes here:
http://java.sun.com/products/jta/javadocs-1.0.1/index.html
You should also use the weblogic.transaction.TransactionManager class and
call "registerDynamicResource" once (and only once) in your application to
register the JMS providers XAResource with JTA. This makes JTA more
efficient, and it makes transaction recovery work properly.
If the JMS provider is MQ, then look at the whitepaper "Using JTA
transactions to envelope WLS JMS and IBM MQSeries" here:
http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
And finally, if you have more questions, the transaction people will be able
to help more. Post to "weblogic.developer.interest.transaction".
greg
"Neeru Munjal" <[email protected]> wrote in message
news:[email protected]...
>
> I am looking for Example of Weblogic Appserver using XA Controlled
Transaction
> to send messages to third party JMS Server.
> I want to send messages to JMS and use Weblogic MDB to consume that
message and
> send it to some third party JMS in a XA Controlled transaction.
>
-
Usage of Apache Beehive JMS control inside Message Driven Bean
Hi,
I am developing a j2ee application using weblogic workshop 10.3. This application contains the following three projects.
- J2EE Utility Project
- Message Driven Bean Project
- Ear Project
In the Utility project I have created one apache beehive jms control. I am using this control inside the message driven bean application. I haven't got any issues during the development and deployment phase with the beehive control. But during runtime the apache beehive jms control is not getting instantiated and the mdb application is throwing the null pointer exception when the EJB container try to execute the methods on the control instance. I have used the declarative programming model to create the control instance inside the mdb application.
I am using the weblogic 10.3 server for testing and I have created the 10.3 weblogic+workshop domain. By default it has the beehive libraries deployed.
Can somebody help me out to resolve this issue?
Regards,
BpYou can get the message directly with getText() method. Following is the snippet of code.
if (aMsg instanceof TextMessage) {
TextMessage msg = (TextMessage) aMsg;
String testMessage = msg.getText());
Kishore. -
Web page breaks when adding utility JARs to my EAR
Hi All,
I am creating a Web Application (.war) that runs some java code and has some JSP web pages to control the code/display results (as a dashboard sort of thing). I have then put this .war file in an enterprise app (.ear file - I have done this as there is other functionality that I want to roll in to the application).
I have been building this in Rational Software Architect and imported the required utility .jar files into the .war project, however when this is built the utility .jars are not included in the exported .ear file (the jsp dashboard pages still display correctly - it just means that the java code cant be run).
To ensure that the utility jar files are included in the exported .ear file I the added the utility jars in to the main .ear project and referenced them from the web app project - this compiles fine - however, when i then view the jsp pages they are now showing blank!
Any ideas as to what might be the problem or why my jsp pages are not showing up once I have added the dependent utility jars in to the ear file?
Thanks in advance guys!Don't use layers, use tables. Outlook doesn't render with the
Internet Explorer engine (since Outlook 2007 at least). You also
can't use padding, background images, external CSS styles, and
dozens of other things. You also need to provide a full path to the
images in the newsletter.
In short, it's NOTHING like designing for a browser.
Here's a giant PDF that will make you cringe:
http://www.campaignmonitor.com/css/reports/Guide_to_CSS_Support_in_Email_2008.pdf
Here's a rough guide to HTML email:
http://www.webmonkey.com/tutorial/Send_HTML-Formatted_E-mail
Lastly, use a third party email service. If you send to more
than fifty people at once you stand a really good chance of getting
your domain blacklisted. Also, did you know that if you don't
provide a way for people to unsubscribe you're breaking the law? Or
if you don't show a physical street address you're in violation of
the law as well? Again, use a third party service so you're
protected against this crap. Also, they're cheap!
http://www.streamsend.com/
http://www.mailchimp.com/ -
Including utility jar when packing ejb in weblogic
Hi,
I am new to j2ee programming. I have an ejb which uses some utility jars. I followed the bea documents to structure the directory. The directory structure is, like,
EjbProject
- classes
--com
---mine
----projectTracking --> has the class files of the ejb and supporting java files
- src
--com
---mine
----projectTracking --> contains the source files of the ejb and the supporting java files
META-INF > contains ejb-jar.xml and weblogic-ejb-jar.xml
The source java files are dependent on an utility jar file.
so when I try the java weblogic.appc src, it throws me exception saying the utility file is missing. My question , is where should I put this utility jar file. Please send me your thoughts.
Thanks in advanceHi,
you can put your utility jar in the ear file along with the EJBs and make a classpath entry to these files in the EJB jar's META-INF\Manifest.mf file. As you said if you are working with weblogic you can put these files any where in the directory structure and place the entry in the startWeblogic.cmd file. But i recomend first option.
Ashok. -
Where to put utility jar (used by EJB's and war)
Hello all,
In many cases when you create a web application including EJB's and a WAR file packaged together in an EAR file, you need some utility classes that are used in the EJB's as wel as in the servlets in the WAR. The utility classes might for example be value object classes that servlets use to exchange data with te EJB's.
My question is: What is the best place to put the utility class files?
There is a new article on JDC: http://developer.java.sun.com/developer/technicalArticles/J2EE/build/ that gives some tips. For example, it proposes to put the utility JAR in the EAR file and then add a "Class-Path:" entry to the MANIFEST.MF of the EJB's that use the utility classes.
However, this approach does not work on BEA Weblogic 6.0. Weblogic's classloader just seems to ignore the "Class-Path:" in the EJB JAR's manifest.
Any thoughts?
regards
JesperThe "CLASS-PATH" mechanism in that article is a new
requirement in J2EE 1.3 (final draft 4). Therefore
right now Weblogic does not support it yet. Now you
need to put those utility classes in both the WAR (in
WEB-INF/lib) and EJB JAR files. If you really want
only 1 copy of the jar file deployed, you can manually
add that jar file to weblogic server classpath in the
start script under config/yourdomain.HI all,
I have some Utility jar file for EJB and Web Application,
In the second solution about one copy in weblogic,
I tried it in the WLS60 it's ok
But it didn't work in WLS61
Anyone could give me any good suggestion?
Moen -
Using a JMS control from an EJB project
I'm developing an EJB in Workshop and my EJB is expected to send messages to a JMS queue. How can I use a JMS control (JCX) from my EJB?
If you're talking about making an executable jar file that will work with the bouncycastle jar:
(1) Make a jar as usual with your classes in it
(2) Include a manifest file that specifies the class containing your app's main() method
(3) In that same manifest, make sure that the bouncycastle jar is included in the Class-Path
Details are in Sun's Tutorial: [Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html] and specifically [http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html|http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html] for the business of having your app recognise the other jar file's classes at runtime.
Doubtless this can all be done from the comfort of your IDE, but I don't know how. There will be documentation on NetBeans site I suppose.
Edited by: pbrockway2 on Jul 23, 2008 8:59 PM -
WL tries to deploy utility jar file in .ear as an EJB
I have an ear containing two ejb jars, one webapp war and a utility jar
(common.jar). Deploying to
WebLogic 6.1 sp2 results in deployment errors because WebLogic thinks
the common.jar in a
lib directory in the ear is an ejb jar:
==================================================================
><Apr 22, 2002 4:42:36 PM MDT> <Error> <J2EE> <Error deploying
>application lib/common:
>
>Unable to deploy EJB: lib/common.jar from lib/common.jar:
>
>An error occurred while reading the deployment descriptor. The error was:
> java.io.FileNotFoundException: META-INF/ejb-jar.xml not found in jar file
> at weblogic.ejb20.dd.xml.DDUtils.getEntry(DDUtils.java:332)
> at weblogic.ejb20.dd.xml.DDUtils.getEjbJarXml(DDUtils.java:236)
>.........
>===================================================================
Why does it think common.jar contains an EJB? My application.xml is:
>
><application>
> <display-name>TestUnit</display-name>
> <module>
> <ejb>TestUnit1.jar</ejb>
> </module>
> <module>
> <ejb>TestUnit2.jar</ejb>
> </module>
> <module>
> <web>
> <web-uri>WebApp1.war</web-uri>
> <context-root>WebApp1</context-root>
> </web>
> </module>
></application>Hi.
Please open a case with support.
Regards,
Michael
Rick Holland wrote:
I have an ear containing two ejb jars, one webapp war and a utility jar
(common.jar). Deploying to
WebLogic 6.1 sp2 results in deployment errors because WebLogic thinks
the common.jar in a
lib directory in the ear is an ejb jar:
==================================================================
<Apr 22, 2002 4:42:36 PM MDT> <Error> <J2EE> <Error deploying
application lib/common:
Unable to deploy EJB: lib/common.jar from lib/common.jar:
An error occurred while reading the deployment descriptor. The error was:
java.io.FileNotFoundException: META-INF/ejb-jar.xml not found in jar file
at weblogic.ejb20.dd.xml.DDUtils.getEntry(DDUtils.java:332)
at weblogic.ejb20.dd.xml.DDUtils.getEjbJarXml(DDUtils.java:236)
===================================================================Why does it think common.jar contains an EJB? My application.xml is:
<application>
<display-name>TestUnit</display-name>
<module>
<ejb>TestUnit1.jar</ejb>
</module>
<module>
<ejb>TestUnit2.jar</ejb>
</module>
<module>
<web>
<web-uri>WebApp1.war</web-uri>
<context-root>WebApp1</context-root>
</web>
</module>
</application>
Michael Young
Developer Relations Engineer
BEA Support -
SAP J2EE Engine JTA Transaction Xml for table TABLE could not be ana
I'm having a weird case. I created 3 entity bean. In my R/3 will call this JCO.Function to do the insert to database. But out of 3 entity bean, only 1 entity bean got error where it unable to insert to database and have this error in the log.
The case is quite weird where i created the same entity but only 1 entity is not working as expected. Wondering what cause this problem.
Thanks.
org.xml.sax.SAXException: Fatal Error: URI=:main: Line=1: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x20(:main:, row:1, col:218)#
at com.sap.dictionary.database.dbs.XmlExtractor$XMLErrorHandler.fatalError(XmlExtractor.java:279)#
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144)#
at com.sap.dictionary.database.dbs.XmlExtractor.map(XmlExtractor.java:130)#
at com.sap.dictionary.database.catalog.DbGeneralStructure.<init>(DbGeneralStructure.java:86)#
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:90)#
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)#
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)#
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)#
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)#
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)#
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)#
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)#
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)#
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)#
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)#
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)#
at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)#
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)#
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)#
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)#
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)#
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)#
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)#
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)#
at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)#
at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)#
at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)#
at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)#
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)#
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)#
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)#
at java.lang.reflect.Method.invoke(Method.java:324)#
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)#
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)#
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)#
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)#
at java.security.AccessController.doPrivileged(Native Method)#
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)#
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)#
##0#0#Error##Java###{0}.commit(), Cannot commit due to unexpected exception in beforeCompletion():
[EXCEPTION]
{1}#2#SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b]#java.lang.IllegalStateException: Xml for table <TABLE> could not be analysed
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
#1.5 #001A6467CDF400590000004E000018D8000459BB785F496C#1224561620123#com.sap.engine.services.ts#sap.com/ESolutionsEGatewayEAR#com.sap.engine.services.ts#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error#1#/System/Server#Java#ts_0004##Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).#1#SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b]#
#1.5 #001A6467CDF400590000004F000018D8000459BB785F4BC5#1224561620123#com.sap.engine.services.ts#sap.com/ESolutionsEGatewayEAR#com.sap.engine.services.ts#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error#1#/System/Audit#Java###Exception {0}#1#com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.lang.IllegalStateException: Xml for table ZREASON_CODE could not be analysed
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
... 16 more
#1.5 #001A6467CDF4005900000050000018D8000459BB785F4E8F#1224561620123#com.sap.engine.services.ejb.entity.Container#sap.com/ESolutionsEGatewayEAR#com.sap.engine.services.ejb.entity.Container#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Java###null
[EXCEPTION]
{0}#1#com.sap.engine.services.ejb.exceptions.BaseRemoteException: Transaction system failure in method net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(net.tnb.model.ReasonCodeBean).
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:573)
at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
... 15 more
Caused by: java.lang.IllegalStateException: Xml for table ZREASON_CODE could not be analysed
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
... 16 more
#1.5 #001A6467CDF4005900000051000018D8000459BB785F5FA9#1224561620123#System.err#sap.com/ESolutionsEGatewayEAR#System.err#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Plain###RemoteException insertOk=false#
#1.5 #001A6467CDF4005900000052000018D8000459BB785F6094#1224561620123#System.err#sap.com/ESolutionsEGatewayEAR#System.err#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Plain###Tue Oct 21 12:00:20 SGT 2008 java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Transaction system failure in method net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(net.tnb.model.ReasonCodeBean).
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:573)
at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
... 15 more
Caused by: java.lang.IllegalStateException: Xml for table <TABLE> could not be analysed
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
... 16 more
; nested exception is:
javax.transaction.RollbackException: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.lang.IllegalStateException: Xml for table ZREASON_CODE could not be analysed
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
... 16 moreHi Stefan and Everyone,
I have solved my problem. Just want to let everyone know if u have to install the SP's for WEB AS 6.30/6.40.
You start from the installation from CD 6.30/6.40. Everything will be working at this point. You can login to Visual Admin, Config tool and SDM.
Before you apply any SP's, do the following:
a) Create an emergency user with the Administrator rights: Ref OSS Note:669848
Try to follow this route for SP's:
From CD 6.30/6.40 -> SP04 -> SP07
Apply SP04 first before applying SP07 (Recommended Approach).
Refer the installation guide: SAP Web AS Support Package Guide 630SP2 to 640SP4.
Use JDK1.4.2_05 to install SP04. You must reference the following OSS Notes and apply to your system accordingly, this is the key to an error free installation:
a) OSS Note: 697535
b) OSS Note: 709140
c) OSS Note: 716604
d) OSS Note: 706378
You have to be really careful with SP04 installation, because it changes the version from 6.30 -> 6.40.
Once you are able to install SP04 without any problems, you can directly apply SP07 or the highest 6.40 SP.
Kind Regards,
Buddha. -
Problem in Creating a jar file using java.util.jar and deploying in jboss 4
Dear Techies,
I am facing this peculiar problem. I am creating a jar file programmatically using java.util.jar api. The jar file is created but Jboss AS is unable to deploy this jar file. I have also tested that my created jar file contains the same files. When I create a jar file from the command using jar -cvf command, Jboss is able to deploy. I am sending the code , please review it and let me know the problem. I badly require your help. I am unable to proceeed in this regard. Please help me.
package com.rrs.corona.solutionsacceleratorstudio.solutionadapter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import com.rrs.corona.solutionsacceleratorstudio.SASConstants;
* @author Piku Mishra
public class JarCreation
* File object
File file;
* JarOutputStream object to create a jar file
JarOutputStream jarOutput ;
* File of the generated jar file
String jarFileName = "rrs.jar";
*To create a Manifest.mf file
Manifest manifest = null;
//Attributes atr = null;
* Default Constructor to specify the path and
* name of the jar file
* @param destnPath of type String denoting the path of the generated jar file
public JarCreation(String destnPath)
{//This constructor initializes the destination path and file name of the jar file
try
manifest = new Manifest();
jarOutput = new JarOutputStream(new FileOutputStream(destnPath+"/"+jarFileName),manifest);
catch(Exception e)
e.printStackTrace();
public JarCreation()
* This method is used to obtain the list of files present in a
* directory
* @param path of type String specifying the path of directory containing the files
* @return the list of files from a particular directory
public File[] getFiles(String path)
{//This method is used to obtain the list of files in a directory
try
file = new File(path);
catch(Exception e)
e.printStackTrace();
return file.listFiles();
* This method is used to create a jar file from a directory
* @param path of type String specifying the directory to make jar
public void createJar(String path)
{//This method is used to create a jar file from
// a directory. If the directory contains several nested directory
//it will work.
try
byte[] buff = new byte[2048];
File[] fileList = getFiles(path);
for(int i=0;i<fileList.length;i++)
if(fileList.isDirectory())
createJar(fileList[i].getAbsolutePath());//Recusive method to get the files
else
FileInputStream fin = new FileInputStream(fileList[i]);
String temp = fileList[i].getAbsolutePath();
String subTemp = temp.substring(temp.indexOf("bin")+4,temp.length());
// System.out.println( subTemp+":"+fin.getChannel().size());
jarOutput.putNextEntry(new JarEntry(subTemp));
int len ;
while((len=fin.read(buff))>0)
jarOutput.write(buff,0,len);
fin.close();
catch( Exception e )
e.printStackTrace();
* Method used to close the object for JarOutputStream
public void close()
{//This method is used to close the
//JarOutputStream
try
jarOutput.flush();
jarOutput.close();
catch(Exception e)
e.printStackTrace();
public static void main( String[] args )
JarCreation jarCreate = new JarCreation("destnation path where jar file will be created /");
jarCreate.createJar("put your source directory");
jarCreate.close();Hi,
I have gone through your code and the problem is that when you create jar it takes a complete path address (which is called using getAbsolutePath ) (when you extract you see the path; C:\..\...\..\ )
You need to truncate this complete path and take only the path address where your files are stored and the problem must be solved. -
JMS adapter transaction. Rollback message to queue.
Hi all !
A have question about jms adapter transaction. My composite application has 3 steps : JMS adapter (listener), mediator, WS adapter. JMS adapter listen queue push message to mediator, mediator invoke web service. If ws not available (server down), mediator try recovery 5 times. After 5 times, reject message from queue. I wont rollback message to queue. I saw examples with JMS + BPEL, but it not help me. Anybody can help me.Hi,
You don’t need to catch a mediator fault – you can let it rollback to the JMS Queue and let the Queue do the retries.
To get the retries working, log in to the weblogic console and navigate to JMS Modules -> Your Module -> Your Queue -> Configuration -> Delivery Failure
Here you will find options for Redelivery Limit. Set this to the number of retries you need.
Then navigate to the connection factory you want and set the redelivery delay.
This should get your desired behaviour, but once the message has failed it will be discarded. If you prefer to put it on an error queue you can create an error queue, and in the original queue’s, goto Delivery Failure, change the expireation policy and set the Error Destination to be your error queue.
Hope that helps!
Robert -
Hi,
I want to publish a message to a message queue using JMS control in
pageflow. The JMS control is configured properly, it has set
connection-factory-jndi-name, send-type and send-jndi-name.
Receive-jndi-name is not set because the control doesn't consume messages.
In pageflow, there is an action containing code:
//create message
Message message = myJMSControl.getSession().createTextMessage("some text");
//send message
myJMSControl.sendJMSMessage(message);
In runtime I get an exception when creating a message:
weblogic.jms.common.IllegalStateException: Session is closed
at weblogic.jms.client.JMSSession.checkClosed(JMSSession.java:2729)
at weblogic.jms.client.JMSSession.createMessage(JMSSession.java:548)
at Controller.startPeriod(Controller.jpf:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.
java:1262)
at
com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowControl
ler.java:1214)
Am I doing something wrong? Is there any other way how to create a message?
I wrote a standalone test client which publish a message to the same queue
using the same factory. All goes well. The code is:
ctx = new InitialContext(env);
qConFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qCon = qconFactory.createQueueConnection();
qSession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE);
qSender = qSession.createSender(queue);
msg = qSession.createTextMessage("some text");
qcon.start();
qsender.send(msg, DeliveryMode.PERSISTENT, priority, ttl);
Thanks for advice,
TomasTomas,
This seems like an issue. The error does not happen when you use the same
code in a WebService. This also does not happen for a JMSControl which
accepts a TextMessage such as
myJMSControl.sendTextMessage("tomas");
I will file a change request for this.
Thanks for the feedback.
Regards,
Anurag
"Tomas Koutny" <[email protected]> wrote in message
news:[email protected]...
Hi,
I want to publish a message to a message queue using JMS control in
pageflow. The JMS control is configured properly, it has set
connection-factory-jndi-name, send-type and send-jndi-name.
Receive-jndi-name is not set because the control doesn't consume messages.
In pageflow, there is an action containing code:
//create message
Message message = myJMSControl.getSession().createTextMessage("sometext");
//send message
myJMSControl.sendJMSMessage(message);
In runtime I get an exception when creating a message:
weblogic.jms.common.IllegalStateException: Session is closed
atweblogic.jms.client.JMSSession.checkClosed(JMSSession.java:2729)
atweblogic.jms.client.JMSSession.createMessage(JMSSession.java:548)
at Controller.startPeriod(Controller.jpf:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.
java:1262)
at
com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowControl
ler.java:1214)
Am I doing something wrong? Is there any other way how to create amessage?
>
>
I wrote a standalone test client which publish a message to the same queue
using the same factory. All goes well. The code is:
ctx = new InitialContext(env);
qConFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qCon = qconFactory.createQueueConnection();
qSession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE);
qSender = qSession.createSender(queue);
msg = qSession.createTextMessage("some text");
qcon.start();
qsender.send(msg, DeliveryMode.PERSISTENT, priority, ttl);
Thanks for advice,
Tomas -
WLS 7.0 - util jars being accessed from the war file
Some of classes in the warfile (servlets) need access to some of the util jars in my ear file. I really don't want to put them in the war file/WEB-INF/lib directory and in the ear file. Is there any way to do this without putting them in the classpath.
Any info would be appreciated.
Thanks,
IanIan,
Examine the following link on packaging utility classes and the Weblogic classloader
architecture
This link should provide (hopefully :-) ) the answer to your question
http://e-docs.bea.com/wls/docs70/programming/classloading.html
Chuck Nelson
DRE
BEA Technical Support -
Java.util.zip java.util.jar API usage
I have been trying unsuccessfully for the past two days to be able to programatically add and extract files into and from a JAR using the API. I haven't found any API docs that cover the basics and I have been stumped using the nuggets that I have found on the Forum so far. Below is the code so far. Feel free to use what works in your programs, but if you find out how to get this to work. Sorry for the long post, but I gather this is a common problem that needs to be solved.
___________JAR CLASS_______________
import java.io.*;
import java.util.*;
import java.util.jar.*;
import java.util.zip.*;
public class Jar {
public Jar() {
public boolean copyToJar(File[] sources, File destination) {
if (destination == null) {
return false;
if (nameContainsWildcards(destination)) {
return false;
File[] sourceArray = expandWildcards(sources);
if (sourceArray == null) {
System.out.println("sourceArray was empty");
return false;
System.out.println("Ready to add " + sourceArray.length + " files to " + destination);
//variables for copying the old destination file to the new destination
File tmpFile = null;
JarFile tmpJarFile = null;
InputStream jarInput = null;
JarInputStream jarIn = null;
InputStreamReader jarDataFile = null;
//variables for the destination
OutputStream output = null;
JarOutputStream jarOut = null;
File input = null;
FileInputStream dataFile = null;
int buf = -1;
if (destination.exists()) {
System.out.println("The destination file exists");
//copy the destination to temporary
//fix copyToJar to use the same .tmp file name as the destination (for reentrant code)
tmpFile = new File(destination.getParent() + "\\" + "jar.tmp");
if (tmpFile.exists()) {
tmpFile.delete();
//rename the original to the TempFile
destination.renameTo(tmpFile);
if (destination.exists()) {
destination.delete();
try {
tmpJarFile = new JarFile(tmpFile);
} catch (IOException ioe) {
System.out.println("Exception while creating JarFile " + ioe );
try {
//initialize the destination
output = new FileOutputStream(destination);
jarOut = new JarOutputStream(output);
//if there is a tmpFile copy contents of tmpFile to the new destination
if (tmpFile != null) {
jarInput = new FileInputStream(tmpFile);
jarIn = new JarInputStream(jarInput);
ZipEntry ze = null;
boolean contains = false;
while((ze = jarIn.getNextEntry()) != null) {
System.out.println("Working on zipEntry " + ze.getName());
contains = false;
for (int i=0; i<sourceArray.length; i++) {
if (ze.getName().compareToIgnoreCase(sourceArray.getName()) == 0) {
contains = true;
if (contains == false) {
jarDataFile = new InputStreamReader(tmpJarFile.getInputStream(ze));
System.out.println("The zip Entry was copied from the old file");
jarOut.putNextEntry(ze);
buf = -1;
buf = jarDataFile.read();
while (buf != -1) {
jarOut.write(buf);
buf = jarDataFile.read();
jarOut.closeEntry();
jarDataFile.close();
jarIn.close();
jarInput.close();
tmpFile.delete();
tmpJarFile.close();
//copy the new files to the destination
for (int i=0; i<sourceArray.length; i++) {
if (sourceArray[i].isDirectory()) {
//fix copyToJar to copy entire directory if the directory is given as a source
} else {
System.out.println("Adding " + sourceArray[i].getAbsolutePath() + " to "
+ destination.getAbsolutePath());
dataFile = new FileInputStream(sourceArray[i]);
ZipEntry entry= new ZipEntry(sourceArray[i].getName());
jarOut.putNextEntry(entry);
buf = -1;
buf = dataFile.read();
while (buf != -1) {
jarOut.write(buf);
buf = dataFile.read();
jarOut.closeEntry();
jarOut.close();
output.close();
dataFile.close();
} catch (IOException ioe) {
System.out.println("Exception " + ioe + " occured while writing the backup jar file.");
try {
if (jarOut != null)
jarOut.close();
if (output != null)
output.close();
if (dataFile != null)
dataFile.close();
if (jarInput != null)
jarInput.close();
if (jarIn != null)
jarIn.close();
} catch (IOException ioe2) {
System.out.println("Exception " + ioe2 + " closing the jar file.");
return false;
return true;
public boolean copyToJar(File source, File destination) {
File[] sourceArray = expandWildcards(source);
if (sourceArray == null) {
System.out.println("sourceArray was empty");
return false;
return copyToJar(sourceArray, destination);
public boolean extractFromJar(File source, File extract, File destDirectory) {
try {
JarFile jarIn = new JarFile(source);
ZipEntry ze = jarIn.getEntry(extract.getName());
if (ze == null) {
System.out.println("Could not find file " + extract + " in jarFile " + source);
} else {
JarInputStream jarInput = null;
InputStreamReader buf = null;
FileOutputStream out = null;
InputStream in = jarIn.getInputStream(ze);
buf = new InputStreamReader(in);
out = new FileOutputStream(extract);
int buffer = -1;
buffer = buf.read();
while (buffer != -1) {
out.write(buffer);
buffer = buf.read();
} catch (IOException ioe) {
System.out.println("Could not extract the file " + extract + " from jarFile " + source);
return false;
return true;
public int numberOfLines(File fileToCount) {
int num = 0;
try {
FileReader regRead = new FileReader(fileToCount);
LineNumberReader regReadLine = new LineNumberReader(regRead);
while (regReadLine.readLine() != null) {
num = regReadLine.getLineNumber();
regRead.close();
regReadLine.close();
} catch (IOException ioe) {
System.out.println("Exception " + ioe + " occured in " + this.getClass().getName());
return num;
static public boolean nameContainsWildcards(File source) {
if (source != null) {
if ((source.getName().indexOf('*')) >=0) {
return true;
//fix this check to look for other wildcards
return false;
* Expands the * wildcard that does not start the expression. For example,
* in a directory whose contents are TEST1.DAT, TEST2.DAT AND TEST3.DAT, this
* funtion will return the following based on the input
* Input Returns
* TEST1.DAT File[] containing the first file
* TEST*.DAT File[] containing all three files plus any that match TEST*.*
* T*.* File[] containing all three files plus any that match T*.*
* *.* File[] containing all three files plus any that match *.*
* EST.DAT File[] containing no files (not a legal expression...yet)
* ? or
public File[] expandWildcards(File source) {
if (source == null) {
System.out.println("Cannot expand wildCards for a null File");
return null;
File[] sourceArray = null;
if (nameContainsWildcards(source)) {
FileFilter wildcardFilter = new WildcardFilter(source.getName());
File sourceParent = new File(source.getParent());
if (sourceParent != null) {
sourceArray = sourceParent.listFiles(wildcardFilter);
} else {
sourceArray = new File[1];
sourceArray[0] = source;
} else {
sourceArray = new File[1];
sourceArray[0] = source;
return sourceArray;
public File[] expandWildcards(File[] sources) {
File[] sourceArray = null;
List fileArrays = new ArrayList();
for (int i=0; i< sources.length; i++) {
fileArrays.add(expandWildcards(sources[i]));
int totalFiles = 0;
for (int i=0; i < fileArrays.size(); i++) {
File[] tmp = (File []) fileArrays.get(i);
if (tmp != null) {
//System.out.println("Adding " + tmp.length + " to total files");
totalFiles += tmp.length;
System.out.println("totalFiles expanded = " + totalFiles);
sourceArray = new File[totalFiles];
int nextIndex = 0;
for (int i=0; i < fileArrays.size(); i++) {
File[] tmp = (File []) fileArrays.get(i);
if (tmp != null) {
for(int j=0; j < tmp.length; j++) {
//System.out.println("Adding file " + tmp[j] + " to sourceArray");
sourceArray[nextIndex] = tmp[j];
nextIndex++;
return sourceArray;
static public void main(String argv[]) {
Jar jarRun = new Jar();
File testFile = new File("D:\\test.jar");
File testFile1 = new File("C:\\Program Files\\RBusinessSystems\\Location Sync\\LONGMONT\\LongmontDefaultCustomers.jar");
File testFile2 = new File("C:\\Program Files\\RBusinessSystems\\Location Sync\\LONGMONT\\LongmontDefaultInventory.jar");
File testFile3 = new File("C:\\Program Files\\RBusinessSystems\\Location Sync\\LONGMONT\\LongmontDefaultVendors.jar");
File testFile4 = new File("C:\\Program Files\\RBusinessSystems\\Location Sync\\LONGMONT\\LongmontDefaultClerks.jar");
if (argv.length >= 1) {
System.out.println("Creating the Jar File");
jarRun.copyToJar(testFile1, testFile);
jarRun.copyToJar(testFile2, testFile);
jarRun.copyToJar(testFile3, testFile);
jarRun.copyToJar(testFile4, testFile);
} else {
System.out.println("Extracting from the Jar File");
jarRun.extractFromJar(testFile, new File("d:\\LongmontDefaultCustomers.jar"), new File("d:\\"));
jarRun.extractFromJar(testFile, new File("d:\\LongmontDefaultInventory.jar"), new File("d:\\"));
jarRun.extractFromJar(testFile, new File("d:\\LongmontDefaultVendors.jar"), new File("d:\\"));
jarRun.extractFromJar(testFile, new File("d:\\LongmontDefaultClerks.jar"), new File("d:\\"));
______________WILDCARD FILTER CLASS __________
import java.io.File;
import java.io.FileFilter;
public class WildcardFilter implements FileFilter {
private String compare = null;
private String wildcardStart = null;
private String wildcardMiddle = null;
private String wildcardEnd = null;
WildcardFilter(String comparison) {
setCompare(comparison);
public void setCompare(String comparison) {
compare = comparison.toLowerCase();
wildcardStart = null;
wildcardMiddle = null;
wildcardEnd = null;
int index = compare.indexOf('*');
if (index != -1) {
wildcardStart = compare.substring(0, index);
if (index + 1 < compare.length()) {
wildcardEnd = compare.substring(index + 1, compare.length());
System.out.println("Expanding fileNames starting with " + wildcardStart
+ " and ending with " + wildcardEnd);
public boolean accept(File check) {
String checkName = check.getName().toLowerCase();
if (compare == null) {
return false;
if (((wildcardEnd == null) || (wildcardEnd.compareTo("") == 0))
&& ((wildcardStart == null) || (wildcardStart.compareTo("") ==0))) {
return false;
if (((wildcardStart == null) || (wildcardStart.compareTo("") ==0))
&& (wildcardEnd != null)) {
if ((wildcardEnd.compareTo(".*") ==0) || (wildcardEnd.compareTo("*") == 0))
return true;
if (checkName.endsWith(wildcardEnd))
return true;
if (((wildcardEnd == null) || (wildcardEnd.compareTo("") == 0))
&& (wildcardStart != null)) {
if (checkName.startsWith(wildcardStart))
return true;
if ((checkName.startsWith(wildcardStart))
&& (checkName.endsWith(wildcardEnd))) {
return true;
return false;I figured it out based on some of the other posts I found on this Forum. Following is the working code. While this code is not as robust as it needs to be for production, it will at least get you started on extracting from jar files and writing to jarfiles.
import java.io.*;
import java.util.jar.*;
import java.util.zip.*;
//NOTE: You can only copy entries created by the Jar tool
class JarTest {
JarTest() {
public boolean copyToJar(File[] fileList, File jarFile) {
JarEntry je = null;
File tmpFile = null;
FileOutputStream fos = null;
JarOutputStream jos = null;
BufferedWriter bw = null;
FileInputStream fis = null;
JarInputStream jis = null;
BufferedReader br = null;
int buf = -1;
boolean badZipFile = false;
boolean refreshFromNewFile = false;
String tmpFileName = jarFile.getAbsolutePath() + ".tmp";
try {
tmpFile = new File(tmpFileName);
fos = new FileOutputStream(tmpFile);
jos = new JarOutputStream(fos);
bw = new BufferedWriter(new OutputStreamWriter(jos));
} catch (IOException ioe) {
ioe.printStackTrace();
if(jarFile.exists()) {
try {
fis = new FileInputStream(jarFile);
jis = new JarInputStream(fis);
br = new BufferedReader(new InputStreamReader(jis));
} catch (IOException ioe) {
System.out.println(ioe);
try {
while((je = jis.getNextJarEntry()) != null) {
refreshFromNewFile = false;
for (int i = 0; i < fileList.length; i++) {
if (je.getName().compareToIgnoreCase(fileList.getName()) == 0) {
refreshFromNewFile = true;
if (refreshFromNewFile) {
//do nothing so we can add the new file below
} else {
jos.putNextEntry(je);
int index = 0;
buf = -1;
while((buf = br.read()) != -1) {
bw.write(buf);
index++;
System.out.println("Copied entry " + je.getName() + " of " + index + " bytes from " + jarFile.getName());
bw.flush();
jos.closeEntry();
} catch (IOException ioe) {
ioe.printStackTrace();
badZipFile = true;
try {
br.close();
jis.close();
fis.close();
} catch (IOException ioe) {
ioe.printStackTrace();
for (int i = 0; i < fileList.length; i++) {
try {
fis = new FileInputStream(fileList[i]);
br = new BufferedReader(new InputStreamReader(fis));
// write the new entries to the tmpFile
je = new JarEntry(fileList[i].getName());
jos.putNextEntry(je);
int index = 0;
buf = -1;
while((buf = br.read()) != -1) {
bw.write(buf);
index++;
bw.flush();
System.out.println("Added entry " + je.getName() + " of " + index + " bytes.");
jos.closeEntry();
} catch (IOException ioe) {
ioe.printStackTrace();
badZipFile = true;
try {
jos.close();
if (tmpFile != null) {
// rename the tmpFile to jarFile
jarFile.delete();
tmpFile.renameTo(jarFile);
} catch (IOException ioe) {
ioe.printStackTrace();
return true;
public boolean extractFromJar(File[] fileList, File jarFile) {
ZipEntry zen = null;
BufferedReader br = null;
FileOutputStream fos = null;
BufferedWriter bw = null;
try {
for (int i = 0; i < fileList.length; i++) {
JarFile jar = new JarFile(jarFile);
zen = jar.getEntry(fileList[i].getName());
if (zen == null) {
System.out.println("Could not find the file " + fileList[i].getName() + " in the zip file " + jar.getName());
} else {
File parentDirectory = new File(fileList[i].getParent());
parentDirectory.mkdirs();
InputStream in = jar.getInputStream(zen);
br = new BufferedReader(new InputStreamReader(in));
fos = new FileOutputStream(fileList[i]);
bw = new BufferedWriter(new OutputStreamWriter(fos));
int buf = -1;
int index = 0;
while((buf = br.read()) != -1) {
bw.write(buf);
bw.flush();
index++;
System.out.println("Extracted file " + fileList[i] + " of " + index + " bytes from " + jarFile);
br.close();
bw.close();
} catch (IOException ioe) {
System.out.println(ioe);
return false;
return true;
public static void main(String[] argv) {
JarTest jt = new JarTest();
File jarFile = new File("d:\\test\\test.zip");
File[] fileList1 = new File[] {new File("d:\\test\\CustomerRefreshRequest.bat"),
new File("d:\\test\\CustomerUpdateGet.bat"),
new File("d:\\test\\CustomerUpdateRequest.bat"),
new File("d:\\test\\LongmontDefaultClerks.jar"),
new File("d:\\test\\LongmontDefaultCustomers.jar"),
new File("d:\\test\\LongmontDefaultInventory.jar")};
File[] fileList2 = new File[] { new File("d:\\test\\install.bat"),
new File("d:\\test\\LongmontDefaultVendors.jar"),
new File("d:\\test\\CustomerUpdateSend.bat") };
jt.copyToJar(fileList1, jarFile);
jt.copyToJar(fileList2, jarFile);
File[] fileList3 = new File[] {new File("d:\\test\\temp\\CustomerRefreshRequest.bat"),
new File("d:\\test\\temp\\CustomerUpdateGet.bat"),
new File("d:\\test\\temp\\CustomerUpdateRequest.bat"),
new File("d:\\test\\temp\\LongmontDefaultClerks.jar"),
new File("d:\\test\\temp\\LongmontDefaultCustomers.jar"),
new File("d:\\test\\temp\\LongmontDefaultInventory.jar")};
File[] fileList4 = new File[] { new File("d:\\test\\temp\\INSTALL.BAT"),
new File("d:\\test\\temp\\LongmontDefaultVendors.jar"),
new File("d:\\test\\temp\\CustomerUpdateSend.bat") };
jt.extractFromJar(fileList3, jarFile);
jt.extractFromJar(fileList4, jarFile); -
Ejb jar - packaging utility jars or classes?
Currently I have an ejb jar that contains 1 bean (say ejb1.jar). This bean uses some utility classes (say util.jar). If I add the actuall .class files from util.jar to ejb1.jar everything works great. If I add util.jar to ejb1.jar I get errors like:
Unable to deploy EJB: SomeBean from ejb1.jar.jar:
java.lang.NoClassDefFoundError: com/xxxx/xxxx/SomeClass
Shouldn't adding the util.jar file directly to the ejb1.jar file work? Do I have to do anything extra to get it to work?
thanks,
ryanhttp://edocs.bea.com/wls/docs70/programming/classloading.html#1069420
"Ryan Van Luttikhuisen" <[email protected]> wrote in message
news:[email protected]..
Currently I have an ejb jar that contains 1 bean (say ejb1.jar). Thisbean uses some utility classes (say util.jar). If I add the actuall .class
files from util.jar to ejb1.jar everything works great. If I add util.jar
to ejb1.jar I get errors like:
>
Unable to deploy EJB: SomeBean from ejb1.jar.jar:
java.lang.NoClassDefFoundError: com/xxxx/xxxx/SomeClass
Shouldn't adding the util.jar file directly to the ejb1.jar file work? DoI have to do anything extra to get it to work?
>
thanks,
ryan--
Dimitri
Maybe you are looking for
-
I have money in my Itunes account, but have forgotten the answers to my security questions. The rescue email address that was linked to my account is no longer valid and I can't access it any more. How do I re-set my security questions and rescue ema
-
After 10.4.3 upgrade, problems resuming from standby
I have a Powerbook G3 Pismo 400 MHz with 576 MB RAM. After upgrading to 10.4.3, every time I open the lid to resume from standby, the powerbook freezes, even when no programs are open. It shows the desktop as it was previously, but the mouse will not
-
Reader and Pro 9 fighting poorly together
I have a user with Acrobat Pro 9 installed. She goes to a website and tries to open a PDF file. She gets a message that she needs to install Reader 8 or 9 in order to read the file. Heck...she HAS Pro 9...what's going on? I do think she had the TRIAL
-
My iphone 4 was in airplane mode - when i turned it back on all my contacts had disappeared. How do i restore them?
-
I'm trying to build QEMU 1.2.0 with --static: LINK qemu-ga /usr/bin/ld: cannot find -lgthread-2.0 /usr/bin/ld: cannot find -lglib-2.0 qemu-sockets.o: In function `inet_listen_opts': /home/ashutosh/man-builds/qemu-1.2.0/qemu-sockets.c:141: warning: Us