• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

J2EE Development with JBoss3.2

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all thanks a lot for your kind reply.It seems to be that with
ur help i have been able to sort out database problem.
But there is a new problem now?
I am trying to build a J2EE application with JBoss and PostgreSQL.I have tested datasource configuration with a test servlet.There is absolutely no problem with it.
But i am really confused with configuring so many files.Can anyone tell me if i am right?
Strangely my application works....?
I mean Whatever debug mseesages( System.out.println() ) i have given all are printed to server console.Most importantly after the statement
"home.create(.....)"
I have printed "Creation Successful" message.Even i can see this printed on server console.But when i go to the corresponding PostgreSQL table i can't see the row which i had tried to insert through my EJB.Where is it?
Is it in HSQL?If yes ,then that is not what i want ! I want the row to be in PostgreSQL table.Can anyone tell me where am i wrong?
In postgres-ds.xml i have following entries
<datasources>
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc ostgresql://192.168.100.18:5432/xsim</connection-url>;
<driver-class>org.postgresql.Driver</driver-class>
<user-name>xsim</user-name>
<password>xsim</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name>
</local-tx-datasource>
</datasources>
In ejb.jar.xml I have following entries...
<entity >
....
<resource-ref>
<res-ref-name>jdbc/MyDSName</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In jbosscmp-jdbc.xml I have following entries
<entity>
<ejb-name>QuestionBean</ejb-name>
<datasource>jdbc/MyDSName</datasource>
<datasource-mapping>PostgreSQL</datasource-mapping>
<create-table>false</create-table>
<table-name>newquestion</table-name>
...........
In jboss.xml i have following entries
<entity>
<ejb-name>QuestionBean</ejb-name>
<jndi-name>QuestionBean</jndi-name>
<resource-ref>
<res-ref-name>jdbc/MyDSName</res-ref-name>
<jndi-name>java:/PostgresDS</jndi-name>
</resource-ref>
<method-attributes>
</method-attributes>
</entity>
<entity>
<ejb-name>ChoiceBean</ejb-name>
<local-jndi-name>ChoiceBean</local-jndi-name>
<method-attributes>
</method-attributes>
</entity>
</enterprise-beans>
<resource-managers>
<resource-manager>
<res-name>jdbc/MyDSName</res-name>
<res-jndi-name>jdbc/MyDSName</res-jndi-name>
</resource-manager>
</resource-managers>
</jboss>
In web.xml
<resource-ref >
<res-ref-name>jdbc/MyDSName</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In jboss-web.xml
<resource-ref>
<res-ref-name>jdbc/MyDSName</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/PostgresDS</jndi-name>
</resource-ref>
 
reply
    Bookmark Topic Watch Topic
  • New Topic