bookstore sample app – Invalid resource

Splash Forums Rewrite Users bookstore sample app – Invalid resource

This topic contains 8 replies, has 3 voices, and was last updated by  banifou 2 years, 12 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #24497

    banifou
    Participant

    When I try to deploy the bookstore sample app on Glassfish, I get this error:

    Invalid resource : java:jboss/datasources/ExampleDS__pm
    java.lang.RuntimeException: Invalid resource : java:jboss/datasources/ExampleDS__pm

    The same when I try running the app with Netbeans.
    Any help, how to get the app running on Glassfish or Apache Tomcat? Thanks

    #24532

    I’m not sure exactly, but I believe that this data-source needs to be converted for glassfish. Christian will need to commend on this.

    #24544

    Hey,

    sorry for my late response. The forum notification were broken and therefore I missed your post.

    Lincoln is right. I created the sample application for JBoss AS 7.1.1 and the application uses the default in-memory database of AS7. You will have to replace the name of the datasource in two places:

    https://github.com/ocpsoft/rewrite/blob/master/showcase/bookstore/src/main/resources/META-INF/persistence.xml#L6

    https://github.com/ocpsoft/rewrite/blob/master/showcase/bookstore/src/main/java/org/ocpsoft/rewrite/showcase/bookstore/dao/DatabaseInitializer.java#L42

    Perhaps you will have to modify some other stuff. I also tried to get the example app to work on Glassfish and had some trouble because one of the database columns is named “year” which is a reserved word in Derby. Another possible issue is that I’m using a Hibernate-specific property to enable automatic creation of the database schema. You will have to replace this with something for EclipseLink, which is the default JPA provider in Glassfish AFAIK.

    I guess I should remove the database stuff from the example and create a dummy DAO that returns fixed entities instead. I’ll create a ticket for this.

    #24545

    I created an issue to track this:

    https://github.com/ocpsoft/rewrite/issues/122

    #24546

    banifou
    Participant

    OK, thanks for the reply.

    #24547

    Let me know if you run into other problems. 🙂

    #24548

    I just found some time to fix this. If you get an updated version of the bookstore app from the repository, you should now be able to deploy it without any changes to Glassfish. The app now doesn’t use a database anymore. I hope this helps. 🙂

    #24549

    banifou
    Participant

    I tried here: http://repo1.maven.org/maven2/org/ocpsoft/rewrite/rewrite-examples/2.0.5.Final/
    It’s not updated! Where can I found the updated version? Thanks

    #24550

    banifou
    Participant

    Found it!And it works fine under Glassfish.
    Thanks a lot.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Comments are closed.