Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where to place the context.xml correctly.

 
Ravi Sree
Ranch Hand
Posts: 64
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am working on a project of a bank application using servlet/jsp with mvc pattern for front-end.
Also as per the ideal way the business and data layer should reside in a ejb container.
Now here, there is this context.xml which states the resource for a JDBCConnection Pool Datasource is
placed under web project's META-INF folder.

I wanted to know if it is possible that this resource reference is accessible from the ejb layer or it should/can be passed to the ejb
layer (which ofcourse is referenced by the web project) for data layer actions.

The main reason that convinced me of using the ejb layer so that data processing and
transaction is more secure, also i plan to use stateless session beans only and no cmp.

I would like suggestions on whether i need to change something since im just at beginner level
in working with ejb.

Thanks in advance.

Regards,
Sree
 
Ravi Sree
Ranch Hand
Posts: 64
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

What i exactly wanted was to know exactly where to specfiy the Datasource and other resources
for the JNDI to be accessible all over the application.
With the habit of having using Tomcat i declared the datasource in the context.xml
and put in the META-INF folder.
And recently I switched to JBoss and thought since it has tomcat embedded in it, this will suffice.
But on a second thought i decided to separate the business and data layer from the front-end (web for now),
start with EJB (2.0 for a start), which made me think since i will have to deploy
this as a application file(.ear file) how will the ejb container get the datasource resource declaration.
hence the reason for this post. but after some more searching, i was able to find that creating '-ds.xml'
and placing in the deployment directory will do what i needed.

I thought i should post what i found.

Regards,
Sree
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic