i have tried to write a progect with datasource declared for variabels
environments for my TOMEE installed on openshift .

i have tried like you have explanaided me but not work.

YOu can view it please ?

the resoures.xml it is:
-------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<resources>

<Resource id="jdbc/databaseopenshift_managed" type="DataSource"> 
    JdbcDriver  com.mysql.jdbc.Driver 
    JdbcUrl jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:
${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME} 
    UserName    ${OPENSHIFT_MYSQL_DB_USERNAME} 
    Password     ${OPENSHIFT_MYSQL_DB_PASSWORD} 
     JtaManaged true
</Resource> 
<Resource id="jdbc/databaseopenshift_unmanaged" type="DataSource"> 
    JdbcDriver  com.mysql.jdbc.Driver 
    JdbcUrl jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:
${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME} 
    UserName    ${OPENSHIFT_MYSQL_DB_USERNAME} 
    Password     ${OPENSHIFT_MYSQL_DB_PASSWORD} 
     JtaManaged false
</Resource> 


</resources>
------------------------------------------------

the persistence.xml it is:

--------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
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_2_0.xsd";>
  <persistence-unit name="provavariabiliambientePU"
transaction-type="JTA">

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <jta-data-source>jdbc/databaseopenshift_managed</jta-data-source>

<non-jta-data-source>jdbc/databaseopenshift_unmanaged</non-jta-data-source>
    <class>entita.Variabile</class>
    <class>entita.Persona</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>
    </properties>
  </persistence-unit>
</persistence>







provavariabiliambiente.zip (34K) 
<http://openejb.979440.n4.nabble.com/attachment/4664234/0/provavariabiliambiente.zip>




--
View this message in context: 
http://openejb.979440.n4.nabble.com/Re-i-have-tried-but-not-work-tp4664234.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to