I am a little new to J2EE. I have a EJB3 project and I want to run a class on application start-up, how can I do that?
I know in EJB3.1 I can use #startup and #singleton unfortunately that is not a option and I have to use EJb3 and java 5. I have done some research and there were a few solutions but I have been unable to make it work.
WebSphere Application Server version 6.1 does not support EJB3 with a standard installation. You also need to have a feature pack for EJB 3.0 installed.
See this information on the IBM site.
If this is not your issue you should update your question with more detail of what goes wrong.
Your only options prior to WebSphere 8 (with EJB 3.1 support) are:
WebSphere startup beans. These are a programming model extension
Package a WAR with the application, and use a ServletContextListener to initialize state used by the EJBs.
Related
It has been almost a month since i started working with jsf and jboss. I've worked with jsf before. But i didn't use jboss, just apache with it.
I've done a bit of search and i found that JBOSS is:
WildFly, formerly known as JavaBeans Open Source Software Application Server is an application server that implements the Java Platform, Enterprise Edition. JBoss is written in Java and as such is cross-platform: usable on any operating system that supports Java.
And instead of managed beans, there are Action classes. As far as i know, the concept is the same, but some annotations are different.
Are these the only differences between jsf with and without jboss? What good does it do in a jsf application? Is jboss really required?
No, you don't need specifically JBoss AS (now Wildfly, the name has been recently changed) but you obviously need some web container (de facto web server) which run JSF applications (for instance Tomcat, Jetty, Resin or Wildfly).
Difference between plain web container (Tomcat, Jetty) and application server (Wildfly, Glassfish) is that in AS you can use Java EE technologies like EJB or JMS. For JSF the difference is that JSF libraries are usually bundled with application server so you don't have to put them into your WAR file (or have scope provided in Maven).
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to EJB 3.1 Deployment in Tomcat 5.5.x
Blockquote
Any buddy please help me i have an web space with apache tomcat 5.0 jsp 2.0 and jvm 1.6
and i want to use ejb in my project so please tell me what should i do that i can use ejb 3.1 in my web space which have these resources listed below
i) Tomcat - 5.5.xSupport
ii)JDK - 1.6.x Support
iii)JSP/servlet - 2.0 Support
so how can i use EJB with web application with this available resources i mean what should i do to these things
Please Help me...!!!
It's not possible, go download JBoss AS or GlassFish.
Tomcat implements just the web container part of Java EE
It's definitely possible and in some cases I prefer the option of using a lightweight container instead of a more heavy weight application server. Having said this though the version of Tomcat your using is too old and won't work anyway without some serious messing about with the container (changing some JARs that come preinstalled with Tomcat), even with that I'm not sure it will work.
As Bozho says, try OpnEJB, but go for JBoss or Glassfish if you can. Tomcat is a JSP container and therefore not meant to this kind of use. EJB run on Application servers.
I'm working on a web application that is Java EE 5. I may be able to upgrade it to EE 6 at some point, but can't at the moment. The web app is running in Tomcat 6. Can I use CDI with it?
I noticed in the Weld documentation that there is a note that I can't use session beans:
There is a major limitation to using a servlet container. Weld doesn't support deploying session beans, injection using #EJB or #PersistenceContext, or using transactional events in servlet containers. For enterprise features such as these, you should really be looking at a Java EE application server.
Does this mean I can't use the #SessionScoped annotation? If so, that would be a show-stopper for using CDI at the moment.
Any thoughts? Thanks.
This is about EJB session beans. You can use CDI with JSF in tomcat 6. Just follow the installation instructions for Weld.
I am trying to deploy a spring message message driven POJO on weblogic 8.1. It is a simple POJO, and it works fine being run outside of an application server, but the messages do not seem to be picked up at all. I have created empty home and remote interfaces, as well as a container bean class that contains an instance of the pojo which it gets from the application context. I then added this container bean class to the ejb-jar.xml as a . I have not been able to get the messages pick up.
Does anyone have any suggestions as to what I am doing wrong? Could anyone point me to a tutorial on how to deploy a MDP?
Thanks.
Here's a tutorial:
http://java-x.blogspot.com/2006/12/implementing-jms-with-spring-message.html
I have no idea what you're talking about when you say "home and remote interfaces". You said Spring POJO, but home and remote interfaces are EJB 2.0 artifacts.
The important question to answer is: Are your message driven component EJBs (MDB) or Spring POJO (MDP)? If they're EJBs, I totally understand why you need home and remote interfaces. If not, I would say this could be a pure web app, packaged in a WAR, without the EJB XML.
You also need a JMS queue to be set up. Have you done that properly? WebLogic 8.1 means JMS 1.0.2.
That's an OLD version of WebLogic and JDK. Why aren't you using WebLogic 10 and JDK 6?
I'm making a little project with Seam, Hibernate and JSF. This project run on JBoss 5.1.
My boss wants to deploy this project on WebLogic. I read on the seam documentation that seam and WebLogic don't work fine together.
I would like to know if I can use Hibernate (with JPA) and JSF on WebLogic and what framework (struts, spring?) I can use to replace Seam.
Edit: I read in the seam documentation (chapter 39, weblogic integration) and I find that:
For several releases of Weblogic there has been an issue with how Weblogic generates stubs and compiles EJB's that use variable arguments in their methods. This is confirmed in the Weblogic 9.X and 10.0.MP1 versions. Unfortunately the 10.3 version only partially addresses the issue as detailed below. So, I want to know if other problems like this exist.
Edit 2: I use Weblogic 10.3
What do you mean by "don't work fine together"? I've already seen Seam applications on WebLogic and the Seam documentation provides detailed instruction to run Seam on WebLogic without mentioning any blocking issue.
If you have something specific in mind, please clarify. But in the current state of the question, my advice would be to stick to Seam and to deploy your application on WLS.