File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes J2EE Development with JBoss3.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "J2EE Development with JBoss3.2" Watch "J2EE Development with JBoss3.2" New topic
Author

J2EE Development with JBoss3.2

Mandar Kulkarni
Greenhorn

Joined: Feb 16, 2004
Posts: 5
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: J2EE Development with JBoss3.2