It looks like the JTA jar isn't being added to the classpath for the
LiftConsole runner. I've never touched scala:console, so I'm not sure what
you would need to do to make it work. Off the top of my head, you might need
to put the dependencies for JPA into the plugin config, but I'm not
positive.

Derek

On Tue, Dec 8, 2009 at 1:16 PM, Janico Greifenberg <j...@acm.org> wrote:

> Hi,
> I've started to experiment with a Lift project that uses JPA for
> persistence. While it works just fine in the web application run with
> mvn jetty:run, I cannot use the model classes from the LiftConsole
> (mvn scala:console -DmainConsole=LiftConsole). When I try for example
>
> Model.find(classOf[Article], 1)
>
> I get the following error:
>
> java.lang.ClassNotFoundException: javax.transaction.SystemException
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>        at java.lang.Clas...
>
> Model is the EntityManager that I created accorting to chapter 10 from
> the Lift book. Article is an entity class and 1 is an id that exists
> in the database.
>
> I'm using lift version 1.1-M7 and the following persistence.xml
>
> <persistence>
>   <persistence-unit name="jpa-dossier" transaction-type="RESOURCE_LOCAL">
>      <properties>
>         <property name="hibernate.dialect"
> value="org.hibernate.dialect.MySQLDialect"/>
>         <property name="hibernate.connection.driver_class"
> value="com.mysql.jdbc.Driver"/>
>         <property name="hibernate.connection.url"
> value="jdbc:mysql://localhost/dossier"/>
>         <property name="hibernate.max_fetch_depth" value="3"/>
>         <property name="hibernate.show_sql" value="true" />
>         <property name="hibernate.hbm2ddl.auto" value="update" /><property
>                name="hibernate.connection.username" value="***">
> </property>
>        <property name="hibernate.connection.password"
> value="***"></property>
>      </properties>
>   </persistence-unit>
> </persistence>
>
> Is there something that I need to initialize to get this to work?
>
> So long
> Janico
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to