I use JBoss 3.2.3. Fragment of my code looks like:
Hashtable props = new Hashtable();
| props.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
| props.put(InitialContext.PROVIDER_URL, "jnp://" + jbossMachine +
":1099");
| props.put(InitialContext.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
|
| InitialContext ctx = new InitialContext(props);
| UserTransaction lTrans = (UserTransaction)ctx.lookup("UserTransaction");
| try
| {
| lTrans.begin();
| ...
| lTrans.commit();
| } catch (Exception e)
| {
| e.printStackTrace();
| try
| {
| lTrans.rollback();
| } catch (Exception ex)
| {
| ex.printStackTrace();
| }
| }
Obtain context and transaction goes well but lTrans.commit() causes me
javax.transaction.SystemException: java.lang.RuntimeException: UT factory lookup
failed: javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an application
resource file: java.naming.factory.initial
| at
org.jboss.tm.usertx.client.ClientUserTransaction.begin(ClientUserTransaction.java:107)
| at
tracker.clients.editors.ProjectEditor.actionInitialized(ProjectEditor.java:693)
| at
tracker.clients.editors.GenericEditor.actionButton_widgetSelected(GenericEditor.java:346)
| at tracker.clients.editors.GenericEditor.widgetSelected(GenericEditor.java:321)
| at
tracker.clients.editors.ProjectEditor.widgetSelected(ProjectEditor.java:388)
Can anybody help me with this problem?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3833011#3833011
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3833011
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development