Re: ojb_blank problem

Armin Waibel <[email protected]> Wed, 05 Sep 2007 16:56:11 +0200
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Hi Hans,

sorry for the late reply.

Hans Novak wrote:
> Hi,
> 
> i need help to run the ojb_blank projekt (i try with mysql & hsql, same 
> errors)
> If i configure it like the tutorial says, i get in eclipse some errors:
> first, i get a lot of errors like this:
> 
> 
> [ojbdoclet] 2007-08-29 13:35:28,017 [main] INFO  
> xdoclet.XDocletMain.start - Running <ojbrepository/>
> [ojbdoclet] Error parsing File 
> /home/hnovak/eclipse-workspace/osfaktura/src/java/AfterBuyImport.java:Lexical 
> error: xjavadoc.TokenMgrError: Lexical error at line 11, column 1.  
> Encountered: "@" (64), after : ""
> [ojbdoclet] Error parsing File 
> /home/hnovak/eclipse-workspace/osfaktura/src/java/de/repcom/osfaktura/core/partner/Partner.java:Encountered 
> "<" at line 255, column 22.
> [ojbdoclet] Was expecting one of:
> [ojbdoclet]     <IDENTIFIER> ...
> [ojbdoclet]     "[" ...
> [ojbdoclet]     "." ...
> [ojbdoclet]     "(" ...
> 
> 
> at the line 255 in Partner.java is Collection<Task> col ...
> It sounds like, that it can recognize the Java 5/6 notation.
> The  "project-schema.xml/sql" is not written correctly. On some classes 
> it miss the foreign-key statements. If i cut the java 5/6 notation out 
> from Collection in the java classes, then it writes it correctly with 
> foreign-key statements.
> 

Think this is problem caused by xdoclet itself, because the error starts 
with
error: xjavadoc.TokenMgrError:
I suppose you need a Java5/6 compatible xdoclet version (xjavadoc).


> Then i get these errors:
> 
> 
> shutdown-check:
> append-shutdown-sql:
>    [echo]
>    [echo]       Executing the create-db.sql script ...
>    [echo]         [sql] Executing resource: 
> /home/hnovak/eclipse-workspace/osfaktura/build/database/create-db.sql
>     [sql] Failed to execute:  ECHO Not implemented      [sql] 
> java.sql.SQLException: Unexpected token: ECHO in statement [ ECHO]
>     [sql] 1 of 2 SQL statements executed successfully

This error always pop up when using hsql. Simply ignore it.


> insert-sql:
> shutdown-check:
> add-shutdown-sql-file:
> [torque-sql-exec] Our new url -> jdbc:hsqldb:build/database/ojb_blank
> [torque-sql-exec] Executing file: 
> /home/hnovak/eclipse-workspace/osfaktura/build/database/project-schema.sql
> [torque-sql-exec] Failed to execute: drop table PARTNER if exists;  ... 
> (SNIP REST OUT) ...
> [torque-sql-exec] Executing file: 
> /home/hnovak/eclipse-workspace/osfaktura/build/database/ojbcore-schema.sql
> [torque-sql-exec] Executing file: 
> /home/hnovak/eclipse-workspace/osfaktura/build/database/shutdown.sql
> [torque-sql-exec] 2 of 3 SQL statements executed successfully
> BUILD SUCCESSFUL
> Total time: 6 seconds
> 
> 
> If i do a:  "mysql db <./project-schema.sql" (and the other two sql 
> scripts) it works fine (except for the "foreign key" statements, i wrote 
> above)

Running torque/ddlutils can cause some drop-table error logs at the 
first time run, when tables do not exist (running hsql with in-memory 
mode this always happens).

regards,
Armin

> 
> 
> Hans
> 
>