0 Replies Latest reply on Mar 24, 2010 8:52 PM by karnati

    Configuring 'persistence.xml' file for Sybase database.

    karnati

      Hi All,


        I'm new to Seam framework and trying my first example with below link


      http://docs.jboss.org/seam/1.0.1.GA/reference/en/html/tutorial.html


        This example is working fine but I'd like to change persistence to sybase rather than jboss DefaultDS.


        Please find modified 'persistence.xml' file as below


      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
                   version="1.0">
                   
         <persistence-unit name="userDatabase">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <!-- <jta-data-source>java:/MyApp</jta-data-source> -->
            <properties>
                       <property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect"/>
               <property name="hibernate.connection.driver_class" value="com.sybase.jdbc3.jdbc.SybDriver"/>
               <property name="hibernate.connection.username" value="test"/>
               <property name="hibernate.connection.password" value="temp123"/>
               <property name="hibernate.connection.url" value="jdbc:sybase:Tds:testDB.org:2222/trial"/>
      
               <property name="hibernate.hbm2ddl.auto" value="update"/>
            </properties>
         </persistence-unit>
         
      </persistence>
      



        After making this change and deploying register example on Tomcat 6.o throwing below error message


      * CONTEXTS IN ERROR: Name -> Error
      
      <UNKNOWN> -> ** UNRESOLVED Demands 'persistence.units:jar=jboss-seam-registratio
      n.jar,unitName=userDatabase **
      
      persistence.units:jar=jboss-seam-registration.jar,unitName=userDatabase -> java.
      lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not
       defined a jta-data-source for a JTA enabled persistence context named: userData
      base
      



        As per this error it is expecting 'jta-data-source', I don't know what to provide for this parameter.


        Can anyone please let me know, how to resolve this error. I'm deploying application on Tomcat 6.0 and I don't have any datasource configuration on this server...


        Thanks in advance.


      Regards,
      Sharath.