You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Ruben DF <rd...@yahoo.es> on 2006/02/09 01:25:30 UTC

about InitiatorApp.java

Hi, 

If you remember, I had this error when I deployed
kandula services on axis:

And now... Some Services
·	InteropService (wsdl) 
o	commit 
o	rollback 
o	phase2Rollback 
o	readonly 
o	volatileAndDurable 
o	earlyReadonly 
o	earlyAborted 
o	replayAbort 
o	replayCommit 
o	retryPreparedCommit 
o	retryPreparedAbort 
o	retryCommit 
o	retryReplay 
o	preparedAfterTimeout 
o	lostCommitted 
o	participantClosed 
o	participantCompensated 
o	participantCanceled 
o	participantExit 
o	participantFault 
o	participantCompensationFault 
o	completionCommit 
o	completionRollback 
o	invalidProtocol 

·	TestSuite1 (wsdl) 
o	testReadonlyCommit 
o	testReadonlyRollback 
o	testRollback 
o	testPrepareCommit 
o	testPrepareRollback 
o	testEarlyCommit 
o	testEarlyRollback 
o	testMarkedRollbackCommit 
o	testMarkedRollbackRollback 
o	testCommitFailure 
o	testRollbackFailure 
o	justReturnOperation 
o	enlistXA_OKOnPrepareResourceOperation 
o	enlistXAExceptionOnPrepareResourceOperation 
o	markTransactionForRollbackOperation 
o	commitTransactionOperation 
o	rollbackTransactionOperation 
o	enlistXAExceptionOnCommitRollbackResourceOperation 
·	faultDispatcher (wsdl) 
AXIS error
Sorry, something seems to have gone wrong... here are
the details:
Exception - org.apache.axis.InternalException:
java.lang.Exception: Method 'process' does not match
any of the valid signatures for message-style service
methods


I fixed the axis error. I just moved all
/target/lib/*.jar files and kandula_*.jar to
catalina/shared/lib(and not to axis/WEB-INF/lib).I
only put interopibm.jar and test-suite1.jar  files to
axis/WEB-INF/lib and the error disappeared. However,
following the step number 5 of user-guide.txt i didn´t
solve the problem.

On the other hand, Test-suite1 works ok but I have a
problem about Interopibm, specifically in
InitiatorApp.java file. I followed the user-guide.txt
and I have an error on step number 8, when I update
InitiatorApp.java. The error is:

Exception in thread "main" AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.NullPointerException
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}hostname:portatilrdf

java.lang.NullPointerException
	at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
	at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
	at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
	at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
	at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
	at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
	at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
	at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
	at
javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
	at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at
org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
	at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at
org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at
org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)

I debugged the code and I realized that the error was
produced in begin() method

public void begin() throws Exception {
		ActivationStub stub = new ActivationStub(new
EndpointReference(
			
"http://localhost:8081/axis/services/activationCoordinator"));
		System.out.println("DESPUES DEL ACTIVATIONSTUB");
		ctx =
stub.createCoordinationContext(ATCoordinator.COORDINATION_TYPE_ID);
AtCoord= "+ATCoordinator.COORDINATION_TYPE_ID);
		cps =
ctx.register(ATCoordinator.PROTOCOL_ID_COMPLETION, new
EndpointReference("http://localhost:8081/axis/services/completionInitiator"));
//I THINK HERE THE ERROR IS PRODUCED!! IN CPS
ASSIGNATION
		SetCoordCtxHandler.setCtx(ctx);
	}

My kandula.properties file is by default (
kandula.context=http://localhost:8081/axis/services/)
(I use tcpmon to redirect) and I use
"org.apache.kandula.geronimo.TxHandler" on
server-config.wsdd file. I changed to
"org.apache.kandula.coordinator.at.TxHandler" but the
problem continued :(, what's wrong? I don't know how
fix it. help!

For that reason, I can not test MyService.java (I
generated the wsdl file, stubs...) because it uses
InitiatorApp.java (begin() method) and I would have
the same problems.

Thanks in advance
Regards



		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: about InitiatorApp.java

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Ruben DF <rd...@yahoo.es>:

> 	You do not need to download jotm* jars or copy j2ee
> jars under the new code. The transaction manager and
> j2ee spec 	jars are provided by Geronimo and are
> downloaded by maven when building Kandula.
> 
> 	The new Kandula_1 code only supports the Geronimo TM
> for tx management.
> 
> 	To get a reference to the TM use Bridge.getTM();
> 
> Here is where I think is wrong, because those files
> should keep at catalina/shared/lib. (In README.1st
> says that should keep in that directory, but says

This is correct. I updated the user-guide (the web page). I still need to go 
through it again. Thanks for pointing it out.

> 
> + for samples/test-suite1 use
> "org.apache.kandula.geronimo.TxHandler" in
> server-config.wsdd
> 
> + for samples/interopibm use
> "org.apache.kandula.coordinator.at.TxHandler"
> 
> It only says about server-config.wsdd file (not
> client-config.wsdd). However, if both files,
> server-config.wsdd and client-config.wsdd, must have
> the same handler, when you downloaded kandula from
> svn, why server-config.wsdd has
> org.apache.kandula.geronimo.TxHandler and
> client-config.wsdd has
> org.apache.kandula.coordinator.at.TxHandler?? Those
> files should have the same handler by default,
> shouldn't they?then, why Test-suite1 works ok having
> different handlers in server and client?
> 
> Well, due to client-config.wsdd has always had the
> coordinator.at handler for me (I haven't update this
> file), the error follow appearing (I have
> server-config.wsdd with coordinator.at handler as the
> client-config.wsdd)
> 
> What happens? Why have I got that error?

The handler used (client or server) depends on the TM.

if you want to use a j2ee TM you need to use the o.a.k.geronimo.TxHandler and 
use Geronimo TM for your tx management.

if you are using the o.a.k.coordinator.at."TM" you need to use
o.a.k.coordinator.at.TxHandler. Note that this is not a full j2ee TM nor do we 
intend to develop it towards that end either. It just provides a convenient 
client interface for those "standalone" applications that just wants to use ws-
at. In future ws-at is likely to bridge different tx domains rather than used 
by itself as demonstrated by the o.a.k.geronimo.Bridge

Presently, we do not support exporting j2ee transactions. So the client side 
handler will always be the latter. However, the server side handler changes on 
what you intend to do. I think I made a mistake in my previous e-mail when I 
asked you to deploy geronimo.TxHandler in both files. Sorry about that.

--dasarath


> 
> other question: is it necesary to update server.xml
> with this code? (test-suite1 works ok without update
> that file) (See step3)
> 
> <Context path="/axis" docBase="axis" debug="0"
> reloadable="true" crossContext="true">
> 		<Resource name="jdbc/myDB" auth="Container"
> type="javax.sql.DataSource"
> 			factory="org.objectweb.jndi.DataSourceFactory"
> 			username="name"
> 			password="pwsd" 
> 			driverClassName="com.mysql.jdbc.Driver"
> 		
> url="jdbc:mysql://localhost/axis?useUnicode=true&amp;characterEncoding=UTF-8"
> />
> 	  	<Resource name="UserTransaction" auth="Container"
> type="javax.transaction.UserTransaction"
> 	  	
> factory="org.objectweb.jotm.UserTransactionFactory"
> 	  		jotm.timeout="60" />
> 	</Context>
> 
> If i need update that file, where I should put the
> code in server.xml , to the end?
> 
> Thanks in advance
> Regards
> 
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: about InitiatorApp.java

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Ruben DF <rd...@yahoo.es>:

> 	You do not need to download jotm* jars or copy j2ee
> jars under the new code. The transaction manager and
> j2ee spec 	jars are provided by Geronimo and are
> downloaded by maven when building Kandula.
> 
> 	The new Kandula_1 code only supports the Geronimo TM
> for tx management.
> 
> 	To get a reference to the TM use Bridge.getTM();
> 
> Here is where I think is wrong, because those files
> should keep at catalina/shared/lib. (In README.1st
> says that should keep in that directory, but says

This is correct. I updated the user-guide (the web page). I still need to go 
through it again. Thanks for pointing it out.

> 
> + for samples/test-suite1 use
> "org.apache.kandula.geronimo.TxHandler" in
> server-config.wsdd
> 
> + for samples/interopibm use
> "org.apache.kandula.coordinator.at.TxHandler"
> 
> It only says about server-config.wsdd file (not
> client-config.wsdd). However, if both files,
> server-config.wsdd and client-config.wsdd, must have
> the same handler, when you downloaded kandula from
> svn, why server-config.wsdd has
> org.apache.kandula.geronimo.TxHandler and
> client-config.wsdd has
> org.apache.kandula.coordinator.at.TxHandler?? Those
> files should have the same handler by default,
> shouldn't they?then, why Test-suite1 works ok having
> different handlers in server and client?
> 
> Well, due to client-config.wsdd has always had the
> coordinator.at handler for me (I haven't update this
> file), the error follow appearing (I have
> server-config.wsdd with coordinator.at handler as the
> client-config.wsdd)
> 
> What happens? Why have I got that error?

The handler used (client or server) depends on the TM.

if you want to use a j2ee TM you need to use the o.a.k.geronimo.TxHandler and 
use Geronimo TM for your tx management.

if you are using the o.a.k.coordinator.at."TM" you need to use
o.a.k.coordinator.at.TxHandler. Note that this is not a full j2ee TM nor do we 
intend to develop it towards that end either. It just provides a convenient 
client interface for those "standalone" applications that just wants to use ws-
at. In future ws-at is likely to bridge different tx domains rather than used 
by itself as demonstrated by the o.a.k.geronimo.Bridge

Presently, we do not support exporting j2ee transactions. So the client side 
handler will always be the latter. However, the server side handler changes on 
what you intend to do. I think I made a mistake in my previous e-mail when I 
asked you to deploy geronimo.TxHandler in both files. Sorry about that.

--dasarath


> 
> other question: is it necesary to update server.xml
> with this code? (test-suite1 works ok without update
> that file) (See step3)
> 
> <Context path="/axis" docBase="axis" debug="0"
> reloadable="true" crossContext="true">
> 		<Resource name="jdbc/myDB" auth="Container"
> type="javax.sql.DataSource"
> 			factory="org.objectweb.jndi.DataSourceFactory"
> 			username="name"
> 			password="pwsd" 
> 			driverClassName="com.mysql.jdbc.Driver"
> 		
> url="jdbc:mysql://localhost/axis?useUnicode=true&amp;characterEncoding=UTF-8"
> />
> 	  	<Resource name="UserTransaction" auth="Container"
> type="javax.transaction.UserTransaction"
> 	  	
> factory="org.objectweb.jotm.UserTransactionFactory"
> 	  		jotm.timeout="60" />
> 	</Context>
> 
> If i need update that file, where I should put the
> code in server.xml , to the end?
> 
> Thanks in advance
> Regards
> 
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: about InitiatorApp.java

Posted by Ruben DF <rd...@yahoo.es>.
Hi Dasarath, I answer you:

 --- Dasarath Weeratunge <dw...@purdue.edu>
escribió:

> Quoting Ruben DF <rd...@yahoo.es>:
>  
> > I fixed the axis error. I just moved all
> > /target/lib/*.jar files and kandula_*.jar to
> > catalina/shared/lib(and not to axis/WEB-INF/lib).I
> > only put interopibm.jar and test-suite1.jar  files
> to
> > axis/WEB-INF/lib and the error disappeared.
> However,
> 
> this is how you should keep these files-- does the
> user guide say something 
> else? I will look at it again.
> 

user-guide.txt says:

step 5:
	Copy kandula-0.2-SNAPSHOT.jar in
%KANDULA_HOME%/target/ directory and jars in
%KANDULA_HOME%/target/lib/ to
		%CATALINA_HOME%/webapps/axis/WEB-INF/lib/

	You do not need to download jotm* jars or copy j2ee
jars under the new code. The transaction manager and
j2ee spec 	jars are provided by Geronimo and are
downloaded by maven when building Kandula.

	The new Kandula_1 code only supports the Geronimo TM
for tx management.

	To get a reference to the TM use Bridge.getTM();

Here is where I think is wrong, because those files
should keep at catalina/shared/lib. (In README.1st
says that should keep in that directory, but says
"copy" and 
i think is "move",because copying I had the same
error)

> > My kandula.properties file is by default (
> >
>
kandula.context=http://localhost:8081/axis/services/)
> > (I use tcpmon to redirect) and I use
> > "org.apache.kandula.geronimo.TxHandler" on
> 
> for the InteropIBM sample you need to use
>  org.apache.kandula.coordinator.at.TxHandler
> 
> (in both client-config.wsdd and server-config.wsdd)
> I think I noted this in the 
> README.1st
> see whether this solves your problem.
> 
> thanks,
> --dasarath
> 

README.1st says:

+ for samples/test-suite1 use
"org.apache.kandula.geronimo.TxHandler" in
server-config.wsdd

+ for samples/interopibm use
"org.apache.kandula.coordinator.at.TxHandler"

It only says about server-config.wsdd file (not
client-config.wsdd). However, if both files,
server-config.wsdd and client-config.wsdd, must have
the same handler, when you downloaded kandula from
svn, why server-config.wsdd has
org.apache.kandula.geronimo.TxHandler and
client-config.wsdd has
org.apache.kandula.coordinator.at.TxHandler?? Those
files should have the same handler by default,
shouldn't they?then, why Test-suite1 works ok having
different handlers in server and client?

Well, due to client-config.wsdd has always had the
coordinator.at handler for me (I haven't update this
file), the error follow appearing (I have
server-config.wsdd with coordinator.at handler as the
client-config.wsdd)

What happens? Why have I got that error?

other question: is it necesary to update server.xml
with this code? (test-suite1 works ok without update
that file) (See step3)

<Context path="/axis" docBase="axis" debug="0"
reloadable="true" crossContext="true">
		<Resource name="jdbc/myDB" auth="Container"
type="javax.sql.DataSource"
			factory="org.objectweb.jndi.DataSourceFactory"
			username="name"
			password="pwsd" 
			driverClassName="com.mysql.jdbc.Driver"
		
url="jdbc:mysql://localhost/axis?useUnicode=true&amp;characterEncoding=UTF-8"
/>
	  	<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"
	  	
factory="org.objectweb.jotm.UserTransactionFactory"
	  		jotm.timeout="60" />
	</Context>

If i need update that file, where I should put the
code in server.xml , to the end?

Thanks in advance
Regards


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: Web service in Kandula and XAResource in MySQL 5.0

Posted by Jack Wang <pi...@yahoo.com>.
Thanks Dasarath.

    XAResource with MySQL has not resolved yet, I will back later.


--- Dasarath Weeratunge <dw...@purdue.edu>写道:

> Quoting Jack Wang <pi...@yahoo.com>:
> 
> > Bank1.creditImpl(acc, dollars) {
> >   // Get tx
> >   org.apache.geronimo.transaction.manager.TransactionManagerImpl tmImpl = 
> >     new org.apache.geronimo.transaction.manager.TransactionManagerImpl();
> 
> don't create another instance of the transaction manager. This will not work. 
> Use the instance created by Kandula.




	

	
		
___________________________________________________________ 
雅虎1G免费邮箱百分百防垃圾信 
http://cn.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: Web service in Kandula and XAResource in MySQL 5.0

Posted by Jack Wang <pi...@yahoo.com>.
Thanks Dasarath.

    XAResource with MySQL has not resolved yet, I will back later.


--- Dasarath Weeratunge <dw...@purdue.edu>写道:

> Quoting Jack Wang <pi...@yahoo.com>:
> 
> > Bank1.creditImpl(acc, dollars) {
> >   // Get tx
> >   org.apache.geronimo.transaction.manager.TransactionManagerImpl tmImpl = 
> >     new org.apache.geronimo.transaction.manager.TransactionManagerImpl();
> 
> don't create another instance of the transaction manager. This will not work. 
> Use the instance created by Kandula.




	

	
		
___________________________________________________________ 
雅虎1G免费邮箱百分百防垃圾信 
http://cn.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: Web service in Kandula and XAResource in MySQL 5.0

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Jack Wang <pi...@yahoo.com>:

> Bank1.creditImpl(acc, dollars) {
>   // Get tx
>   org.apache.geronimo.transaction.manager.TransactionManagerImpl tmImpl = 
>     new org.apache.geronimo.transaction.manager.TransactionManagerImpl();

don't create another instance of the transaction manager. This will not work. 
Use the instance created by Kandula.

>   javax.transaction.Transaction tx = tmImpl.getTransaction();
> 
>   // Get ut and xARes
>   Context ctx = new InitialContext();
>   UserTransaction ut =
> (UserTransaction)ctx.lookup("java:comp/env/UserTransaction");
>   XADataSource xaDs = (XADataSource)ctx.lookup("java:comp/env/jdbc/myXADB"); 
> <-- Oops, NULL value
> !!
>   XAConnection xAConn = xaDs.getXAConnection();
>   XAResource xARes = xAConn.getXAResource();
> 
>   // Enlist xARes
>   tx.enlistResource(xARes);
> 
>   // Begin ut
>   ut.begin();
> 
>   // Operate db
>   java.sql.Connection conn = xAConn.getConnection();
>   Statement stmt = conn.createStatement();
>   PreparedStatement pstmt = conn.prepareStatement("update ...");
> 
>   // Commit ut
>   ut.commit();

As I've told you BEFORE, you should neither begin nor commit the tx. Tx will
be created automatically by the runtime when the method is called. You just have
to obtain a reference to it by some means and then enlist your resources. (Even 
this should be done by the container). You don't seem to understand the concept 
of distributed transaction. I suggest that you read a little bit about how 
ejb's handle transactions. Especially the section on Bean managed tx and 
container managed tx in the EJB spec.


>   // Return
>   return "";
> }
> --------------------------------------
> 
> Question 1)
>   Is the code right ?
> 
> Question 2)
>   I use JDK 1.5, Tomcat 5.5, MySQL: 5.0.18-win32,

if u are using jdk 1.5, please keep in mind that Kandula has ONLY been tested 
on jdk 1.4.2

--dasarath


> mysql-connector-java-5.0.0-beta. I have
> configured the XADataSource in tomcat's server.xml, but I only get a null
> xaDs, Oops !! So there
> is no xARes yet. I have put this question in mysql mail list. This is the
> XADataSource
> configuration in server.xml:
> 
> --------------------------------------
>   <Resource name="jdbc/myXADB" auth="Container"
>     type="javax.sql.XADataSource"
>     factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory"
>     driverClassName="com.mysql.jdbc.Driver"
>     user="root"
>     password="password"
>    
> url="jdbc:mysql://localhost/test?useUnicode=true&amp;characterEncoding=gbk"
>   />
> --------------------------------------
> 
> I still tried to test kandula. Please help. Thanks.
> 
> 
> 
> Wang Jun
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________ 
> ÑÅ»¢1GÃâ·ÑÓÊÏä°Ù·Ö°Ù·ÀÀ¬»øÐÅ 
> http://cn.mail.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: Web service in Kandula and XAResource in MySQL 5.0

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Jack Wang <pi...@yahoo.com>:

> Bank1.creditImpl(acc, dollars) {
>   // Get tx
>   org.apache.geronimo.transaction.manager.TransactionManagerImpl tmImpl = 
>     new org.apache.geronimo.transaction.manager.TransactionManagerImpl();

don't create another instance of the transaction manager. This will not work. 
Use the instance created by Kandula.

>   javax.transaction.Transaction tx = tmImpl.getTransaction();
> 
>   // Get ut and xARes
>   Context ctx = new InitialContext();
>   UserTransaction ut =
> (UserTransaction)ctx.lookup("java:comp/env/UserTransaction");
>   XADataSource xaDs = (XADataSource)ctx.lookup("java:comp/env/jdbc/myXADB"); 
> <-- Oops, NULL value
> !!
>   XAConnection xAConn = xaDs.getXAConnection();
>   XAResource xARes = xAConn.getXAResource();
> 
>   // Enlist xARes
>   tx.enlistResource(xARes);
> 
>   // Begin ut
>   ut.begin();
> 
>   // Operate db
>   java.sql.Connection conn = xAConn.getConnection();
>   Statement stmt = conn.createStatement();
>   PreparedStatement pstmt = conn.prepareStatement("update ...");
> 
>   // Commit ut
>   ut.commit();

As I've told you BEFORE, you should neither begin nor commit the tx. Tx will
be created automatically by the runtime when the method is called. You just have
to obtain a reference to it by some means and then enlist your resources. (Even 
this should be done by the container). You don't seem to understand the concept 
of distributed transaction. I suggest that you read a little bit about how 
ejb's handle transactions. Especially the section on Bean managed tx and 
container managed tx in the EJB spec.


>   // Return
>   return "";
> }
> --------------------------------------
> 
> Question 1)
>   Is the code right ?
> 
> Question 2)
>   I use JDK 1.5, Tomcat 5.5, MySQL: 5.0.18-win32,

if u are using jdk 1.5, please keep in mind that Kandula has ONLY been tested 
on jdk 1.4.2

--dasarath


> mysql-connector-java-5.0.0-beta. I have
> configured the XADataSource in tomcat's server.xml, but I only get a null
> xaDs, Oops !! So there
> is no xARes yet. I have put this question in mysql mail list. This is the
> XADataSource
> configuration in server.xml:
> 
> --------------------------------------
>   <Resource name="jdbc/myXADB" auth="Container"
>     type="javax.sql.XADataSource"
>     factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory"
>     driverClassName="com.mysql.jdbc.Driver"
>     user="root"
>     password="password"
>    
> url="jdbc:mysql://localhost/test?useUnicode=true&amp;characterEncoding=gbk"
>   />
> --------------------------------------
> 
> I still tried to test kandula. Please help. Thanks.
> 
> 
> 
> Wang Jun
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________ 
> ÑÅ»¢1GÃâ·ÑÓÊÏä°Ù·Ö°Ù·ÀÀ¬»øÐÅ 
> http://cn.mail.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Web service in Kandula and XAResource in MySQL 5.0

Posted by Jack Wang <pi...@yahoo.com>.
--- Dasarath Weeratunge <dw...@purdue.edu>写道:
> Say now, that YOU are providing Bank1 (or Bank2 or both)
> 
> Now when you create a DataSource in JDBC it gives you an XAResource interface. 
> You must register this XAResource interface with the local j2ee tx.
> 
> e.g.
> 
> Bank1.creditImpl(acc, dollars) {
> 
> xaRes = createConnection("JDBC:connection string");
> Transaction tx = tm.getTransaction();
> tx.enlistResource(xaRes);
> 
> // SQL statements
> 
> tx.delistResource(xaRes);
> }
> 
> This usually happens transparently if your TM and DB are properly hooked up to 
> your container-- say Tomcat. (However, I've not seen any docs on how to to do 
> this with Geronimo but certainly it is possible.)

I try to code the web service which will be called in a kandula's transaction.

--------------------------------------
Bank1.creditImpl(acc, dollars) {
  // Get tx
  org.apache.geronimo.transaction.manager.TransactionManagerImpl tmImpl = 
    new org.apache.geronimo.transaction.manager.TransactionManagerImpl();
  javax.transaction.Transaction tx = tmImpl.getTransaction();

  // Get ut and xARes
  Context ctx = new InitialContext();
  UserTransaction ut = (UserTransaction)ctx.lookup("java:comp/env/UserTransaction");
  XADataSource xaDs = (XADataSource)ctx.lookup("java:comp/env/jdbc/myXADB");  <-- Oops, NULL value
!!
  XAConnection xAConn = xaDs.getXAConnection();
  XAResource xARes = xAConn.getXAResource();

  // Enlist xARes
  tx.enlistResource(xARes);

  // Begin ut
  ut.begin();

  // Operate db
  java.sql.Connection conn = xAConn.getConnection();
  Statement stmt = conn.createStatement();
  PreparedStatement pstmt = conn.prepareStatement("update ...");

  // Commit ut
  ut.commit();
 
  // Return
  return "";
}
--------------------------------------

Question 1)
  Is the code right ?

Question 2)
  I use JDK 1.5, Tomcat 5.5, MySQL: 5.0.18-win32, mysql-connector-java-5.0.0-beta. I have
configured the XADataSource in tomcat's server.xml, but I only get a null xaDs, Oops !! So there
is no xARes yet. I have put this question in mysql mail list. This is the XADataSource
configuration in server.xml:

--------------------------------------
  <Resource name="jdbc/myXADB" auth="Container"
    type="javax.sql.XADataSource"
    factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory"
    driverClassName="com.mysql.jdbc.Driver"
    user="root"
    password="password"
    url="jdbc:mysql://localhost/test?useUnicode=true&amp;characterEncoding=gbk"
  />
--------------------------------------

I still tried to test kandula. Please help. Thanks.



Wang Jun


	

	
		
___________________________________________________________ 
雅虎1G免费邮箱百分百防垃圾信 
http://cn.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: about InitiatorApp.java

Posted by Ruben DF <rd...@yahoo.es>.
Hi Dasarath, I answer you:

 --- Dasarath Weeratunge <dw...@purdue.edu>
escribió:

> Quoting Ruben DF <rd...@yahoo.es>:
>  
> > I fixed the axis error. I just moved all
> > /target/lib/*.jar files and kandula_*.jar to
> > catalina/shared/lib(and not to axis/WEB-INF/lib).I
> > only put interopibm.jar and test-suite1.jar  files
> to
> > axis/WEB-INF/lib and the error disappeared.
> However,
> 
> this is how you should keep these files-- does the
> user guide say something 
> else? I will look at it again.
> 

user-guide.txt says:

step 5:
	Copy kandula-0.2-SNAPSHOT.jar in
%KANDULA_HOME%/target/ directory and jars in
%KANDULA_HOME%/target/lib/ to
		%CATALINA_HOME%/webapps/axis/WEB-INF/lib/

	You do not need to download jotm* jars or copy j2ee
jars under the new code. The transaction manager and
j2ee spec 	jars are provided by Geronimo and are
downloaded by maven when building Kandula.

	The new Kandula_1 code only supports the Geronimo TM
for tx management.

	To get a reference to the TM use Bridge.getTM();

Here is where I think is wrong, because those files
should keep at catalina/shared/lib. (In README.1st
says that should keep in that directory, but says
"copy" and 
i think is "move",because copying I had the same
error)

> > My kandula.properties file is by default (
> >
>
kandula.context=http://localhost:8081/axis/services/)
> > (I use tcpmon to redirect) and I use
> > "org.apache.kandula.geronimo.TxHandler" on
> 
> for the InteropIBM sample you need to use
>  org.apache.kandula.coordinator.at.TxHandler
> 
> (in both client-config.wsdd and server-config.wsdd)
> I think I noted this in the 
> README.1st
> see whether this solves your problem.
> 
> thanks,
> --dasarath
> 

README.1st says:

+ for samples/test-suite1 use
"org.apache.kandula.geronimo.TxHandler" in
server-config.wsdd

+ for samples/interopibm use
"org.apache.kandula.coordinator.at.TxHandler"

It only says about server-config.wsdd file (not
client-config.wsdd). However, if both files,
server-config.wsdd and client-config.wsdd, must have
the same handler, when you downloaded kandula from
svn, why server-config.wsdd has
org.apache.kandula.geronimo.TxHandler and
client-config.wsdd has
org.apache.kandula.coordinator.at.TxHandler?? Those
files should have the same handler by default,
shouldn't they?then, why Test-suite1 works ok having
different handlers in server and client?

Well, due to client-config.wsdd has always had the
coordinator.at handler for me (I haven't update this
file), the error follow appearing (I have
server-config.wsdd with coordinator.at handler as the
client-config.wsdd)

What happens? Why have I got that error?

other question: is it necesary to update server.xml
with this code? (test-suite1 works ok without update
that file) (See step3)

<Context path="/axis" docBase="axis" debug="0"
reloadable="true" crossContext="true">
		<Resource name="jdbc/myDB" auth="Container"
type="javax.sql.DataSource"
			factory="org.objectweb.jndi.DataSourceFactory"
			username="name"
			password="pwsd" 
			driverClassName="com.mysql.jdbc.Driver"
		
url="jdbc:mysql://localhost/axis?useUnicode=true&amp;characterEncoding=UTF-8"
/>
	  	<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"
	  	
factory="org.objectweb.jotm.UserTransactionFactory"
	  		jotm.timeout="60" />
	</Context>

If i need update that file, where I should put the
code in server.xml , to the end?

Thanks in advance
Regards


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Web service in Kandula and XAResource in MySQL 5.0

Posted by Jack Wang <pi...@yahoo.com>.
--- Dasarath Weeratunge <dw...@purdue.edu>写道:
> Say now, that YOU are providing Bank1 (or Bank2 or both)
> 
> Now when you create a DataSource in JDBC it gives you an XAResource interface. 
> You must register this XAResource interface with the local j2ee tx.
> 
> e.g.
> 
> Bank1.creditImpl(acc, dollars) {
> 
> xaRes = createConnection("JDBC:connection string");
> Transaction tx = tm.getTransaction();
> tx.enlistResource(xaRes);
> 
> // SQL statements
> 
> tx.delistResource(xaRes);
> }
> 
> This usually happens transparently if your TM and DB are properly hooked up to 
> your container-- say Tomcat. (However, I've not seen any docs on how to to do 
> this with Geronimo but certainly it is possible.)

I try to code the web service which will be called in a kandula's transaction.

--------------------------------------
Bank1.creditImpl(acc, dollars) {
  // Get tx
  org.apache.geronimo.transaction.manager.TransactionManagerImpl tmImpl = 
    new org.apache.geronimo.transaction.manager.TransactionManagerImpl();
  javax.transaction.Transaction tx = tmImpl.getTransaction();

  // Get ut and xARes
  Context ctx = new InitialContext();
  UserTransaction ut = (UserTransaction)ctx.lookup("java:comp/env/UserTransaction");
  XADataSource xaDs = (XADataSource)ctx.lookup("java:comp/env/jdbc/myXADB");  <-- Oops, NULL value
!!
  XAConnection xAConn = xaDs.getXAConnection();
  XAResource xARes = xAConn.getXAResource();

  // Enlist xARes
  tx.enlistResource(xARes);

  // Begin ut
  ut.begin();

  // Operate db
  java.sql.Connection conn = xAConn.getConnection();
  Statement stmt = conn.createStatement();
  PreparedStatement pstmt = conn.prepareStatement("update ...");

  // Commit ut
  ut.commit();
 
  // Return
  return "";
}
--------------------------------------

Question 1)
  Is the code right ?

Question 2)
  I use JDK 1.5, Tomcat 5.5, MySQL: 5.0.18-win32, mysql-connector-java-5.0.0-beta. I have
configured the XADataSource in tomcat's server.xml, but I only get a null xaDs, Oops !! So there
is no xARes yet. I have put this question in mysql mail list. This is the XADataSource
configuration in server.xml:

--------------------------------------
  <Resource name="jdbc/myXADB" auth="Container"
    type="javax.sql.XADataSource"
    factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory"
    driverClassName="com.mysql.jdbc.Driver"
    user="root"
    password="password"
    url="jdbc:mysql://localhost/test?useUnicode=true&amp;characterEncoding=gbk"
  />
--------------------------------------

I still tried to test kandula. Please help. Thanks.



Wang Jun


	

	
		
___________________________________________________________ 
雅虎1G免费邮箱百分百防垃圾信 
http://cn.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: about InitiatorApp.java

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Ruben DF <rd...@yahoo.es>:
 
> I fixed the axis error. I just moved all
> /target/lib/*.jar files and kandula_*.jar to
> catalina/shared/lib(and not to axis/WEB-INF/lib).I
> only put interopibm.jar and test-suite1.jar  files to
> axis/WEB-INF/lib and the error disappeared. However,

this is how you should keep these files-- does the user guide say something 
else? I will look at it again.

> My kandula.properties file is by default (
> kandula.context=http://localhost:8081/axis/services/)
> (I use tcpmon to redirect) and I use
> "org.apache.kandula.geronimo.TxHandler" on

for the InteropIBM sample you need to use
 org.apache.kandula.coordinator.at.TxHandler

(in both client-config.wsdd and server-config.wsdd) I think I noted this in the 
README.1st
see whether this solves your problem.

thanks,
--dasarath


> server-config.wsdd file. I changed to
> "org.apache.kandula.coordinator.at.TxHandler" but the
> problem continued :(, what's wrong? I don't know how
> fix it. help!
> 
> For that reason, I can not test MyService.java (I
> generated the wsdl file, stubs...) because it uses
> InitiatorApp.java (begin() method) and I would have
> the same problems.
> 
> Thanks in advance
> Regards
> 
> 
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: about InitiatorApp.java

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Ruben DF <rd...@yahoo.es>:
 
> I fixed the axis error. I just moved all
> /target/lib/*.jar files and kandula_*.jar to
> catalina/shared/lib(and not to axis/WEB-INF/lib).I
> only put interopibm.jar and test-suite1.jar  files to
> axis/WEB-INF/lib and the error disappeared. However,

this is how you should keep these files-- does the user guide say something 
else? I will look at it again.

> My kandula.properties file is by default (
> kandula.context=http://localhost:8081/axis/services/)
> (I use tcpmon to redirect) and I use
> "org.apache.kandula.geronimo.TxHandler" on

for the InteropIBM sample you need to use
 org.apache.kandula.coordinator.at.TxHandler

(in both client-config.wsdd and server-config.wsdd) I think I noted this in the 
README.1st
see whether this solves your problem.

thanks,
--dasarath


> server-config.wsdd file. I changed to
> "org.apache.kandula.coordinator.at.TxHandler" but the
> problem continued :(, what's wrong? I don't know how
> fix it. help!
> 
> For that reason, I can not test MyService.java (I
> generated the wsdl file, stubs...) because it uses
> InitiatorApp.java (begin() method) and I would have
> the same problems.
> 
> Thanks in advance
> Regards
> 
> 
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org