Announcement Announcement Module
Collapse
No announcement yet.
Spring+GlassFish+JPA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment

    Working...
    X