The following code works fine unless I run it from a servlet. I don't
understand the
NoClassDefFoundError. All the other OJB/odmg classes be found but not the
OQLQueryImpl (the class
that is instantiated on line 160 in org.apache.ojb.odmg.OJB.newOQLQuery).
It's in the class path
just like the others.

my servlet does this:
        Implementation odmg=null;
        try {
            Implementation odmg = OJB.getInstance();
            Database db = odmg.newDatabase();
            db.open("db/repository.xml", Database.OPEN_READ_WRITE);
            Transaction tx = odmg.newTransaction();
            tx.begin();
line 48:    EnhancedOQLQuery query = odmg.newOQLQuery();
            DList models = null;
            query.create("select OJBModel from " + OJBModel.class.getName()
+ " where ID = min(ID)");
            models = (DList) query.execute();
            tx.commit();
        } catch (Exception e) {
            e.printStackTrace();
            tx.abort();
        }

The stack trace is this:
java.lang.NoClassDefFoundError: antlr/TokenStreamException
        at org.apache.ojb.odmg.OJB.newOQLQuery(OJB.java:160)
        at com.projexact.test.ServletTest.doGet(ServletTest.java:48)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain

Does anyone know what I'm doing wrong?
Stefaan Nachtergaele


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to