- This topic has 3 replies, 2 voices, and was last updated 13 years, 6 months ago by Brian Fernandes.
-
AuthorPosts
-
trantParticipantIf I have a spec for a project that will use Spring/Hibernate with no actual web-based user interface, is it still advisable to set it up as a web application?
What if I also needed to use JMS in this application?
And then later Web Services?
Also, some co-workers are pushing for it to be deployed as an EAR file simply because the name suggests enterprise application. We dont have any plans to add additional modules at this point though – no EJBs or separate Web modules.
But then the question is how do I deploy this app to the web application server (WebLogic 10). If I setup my project as a web application, it could be one war file – pretty simple right?
Or if I go with an EAR archive it would be an ear with I suppose my project setup as a regular “Java Project” and deployed as a jar inside my ear file.
So what would you suggest? I really want to make it right so I dont face much arguments and I do want to remain flexible for future.
Brian FernandesModeratortrant,
I guess the most flexible solution would be the EAR + Java project as you suggested; with the Java project having Spring + Hibernate capabilities. There is no sense in making it a web project if it has no web interface.
Writing a JMS client should not be a problem as well.
trantParticipant@Support-Brian wrote:
trant,
I guess the most flexible solution would be the EAR + Java project as you suggested; with the Java project having Spring + Hibernate capabilities. There is no sense in making it a web project if it has no web interface.
Writing a JMS client should not be a problem as well.
Ok, thank you for your input – i think that makes good sense.
If I set it up as a regular Java project though, what is the “launching point” ? I.e. what is the class that actually starts when the application is deployed and it initializes spring, hibernate and any other things I decide to do on app startup?
With a web app, I would set things up with servlet initialization and/or context listeners – so when the web app is deployed, this code is run first and I do all my init.
If I am in an EAR file with a standard Java project, where would all this initialization happen? would I have to create a main() and reference the main in the jar’s meta-inf?
Brian FernandesModeratortrant,
Good question about the entry point, but I’m afraid I can’t answer that. It would depend on how you intend to use your application.
You mentioned that your team wanted this deployed, my assumption was that there would be some service offered by this application and when invoked it would trigger your app initialization. However, if there is no intended use in this form yet, perhaps you just need to go standalone for now. You can still have the Java project as part of the EAR, but run it as a standalone app until you have a real reason to go online.
Hope this helps.
-
AuthorPosts