|
Hi Brett,
Thanks for the message.
The problem solved after I have degraded the JDK from 1.5 to 1.4.2. I think it is something wrong in the jdk1.5 in discovering classpath.
Cheers,
Ng Keng Yap.
-------Original Message-------
Date: Friday, September 24, 2004 09:52:55
Subject: Re: [castor-user] The Castor JDO can't find JTA?
You need jta.jar on your classpath. You should find jta1.0.1 in /lib.
Brett
>Subject: [castor-user] The Castor JDO can't find JTA?
>Date: Fri, 24 Sep 2004 09:30:26 +0800
>
>Dear all,
>
>I am a newbie for Castor, I found an error on Castor JDO as follow, as
>anyone here tell me what's wrong?
>
>Environment:
>
>OS Platform: WinXP Pro SP2
>JVM: Java 5
>
>Error Message:
>
>Exception in thread "main" java.lang.NoClassDefFoundError:
>javax/transaction/Synchronization
> at com.smml.toolkit.MyDataBindingManager.<init>(MyDataBindingManager
>java:27)
> at
>com.smml.toolkit.MyDataBindingManager.main(MyDataBindingManager.java:42)
> 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:582)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
>
>Source Code:
>
>package com.smml.toolkit;
>
>import com.smml.castor.Organization;
>import com.smml.castor.OrganizationItem;
>import org.exolab.castor.jdo.Database;
>import org.exolab.castor.jdo.JDO;
>import org.exolab.castor.xml.Marshaller;
>
>import java.io.FileWriter;
>
>/**
> * User: Ng Keng Yap
> * Date: Sep 23, 2004
> * Time: 9:33:52 AM
> */
>public class MyDataBindingManager {
>
> public MyDataBindingManager() {
> try {
> Organization organization = new Organization();
> OrganizationItem oitem[] = new OrganizationItem[1];
> oitem[0] = new OrganizationItem();
> oitem[0].setName("Unviersiti Putra Malaysia");
> organization.setOrganizationItem(oitem);
> Marshaller.marshal(organization, new
>FileWriter("C:\\testing.xml
>));
>
> JDO jdo = new JDO();
> jdo.setDatabaseName("postgresql");
> jdo.setClassLoader(getClass().getClassLoader());
> Database db = jdo.getDatabase();
> db.begin();
> db.create(organization);
> db.commit();
> db.close();
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> }
>
> public static void main(String[] args) {
> new MyDataBindingManager();
> }
>}
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
> unsubscribe castor-user
_________________________________________________________________
Smart Saving with ING Direct ? earn 5.25% p.a. variable rate:
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
unsubscribe castor-user |