Results 1 to 2 of 2

Thread: Spring+GlassFish+JPA

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Default Spring+GlassFish+JPA

    Hello it is my first post in this forum.

    I have an application that work using Tomcat+TopLink+Spring i'd like to change tomcat to glassfish. So i started changing

    this
    <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionM anager">
    <property name="entityManagerFactory" ref="emf" />
    </bean>

    to

    <bean id="txManager" class="org.springframework.transaction.jta.JtaTran sactionManager"/>

    and

    add this property

    <property name="loadTimeWeaver">
    <bean class="org.springframework.instrument.classloading .glassfish.GlassFishLoadTimeWeaver"/>
    </property>

    the application deploys but when it will access the database i get

    Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseExcepti on
    Internal Exception: java.sql.SQLSyntaxErrorException: O esquema 'POSTGRES' não existe
    Error Code: -1
    Call: SELECT ID, NAME FROM PRODUCT
    Query: ReadAllQuery(referenceClass=Product sql="SELECT ID, NAME FROM PRODUCT")

    but it is the same code that runs on tomcat. It looks like that the glassfish is ignoring the persistence.xml 's data connection because i modify the user and password to a wrong data and nothing happen.

    anyone can help me?

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,793

    Default

    Internal Exception: java.sql.SQLSyntaxErrorException:
    O esquema 'POSTGRES' não existe
    Error Code: -1
    Seems the DB connection can't be retrieved

    It looks like that the glassfish is ignoring the persistence.xml 's data connection because i modify the user and password to a wrong data and nothing happen.
    I suggest you read the Glassfish documentation, perhaps it require the persistence.xml file be located in a particular place

    Show your file content where you are connecting with the DB
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •