I am working on migrating code base which has EJB 2.x as well as 3.x code.
How do I identify EJB 2.x code (session beans, message driven beans).
The code uses session beans with annotations and some beans are also defined in ejb-jar.xml.
I thought these annotated beans would be specific to 3.x code and the ones from ejb-jar.xml file would be 2.x beans , but then I found this class
#Stateless
#TransactionManagement(TransactionManagementType.BEAN)
public class ABC implements javax.ejb.SessionBean{
//methods
}
3.x beans do not implement javax.ejb.SessionBean right?
Is the above code snippet 2.x or 3.x ejb?
Let me know your thoughts
2.x EJB are required to implement SessionBean
3.x EJB are not required (but can) implement Session Bean
2.x EJB should have a Home interface
Related
I'm implementing a WebDAV servlet that I want to integrate in a Quarkus-based application, by using the quarkus-undertow extension.
I want to control the initialization of the startup, and injection with the CDI infrastructure in Quarkus would be nice. As I understand it, I can't use the #WebServlet annotation to bind the servlet to an URL mapping.
What is the proper way of initializing and adding custom servlets with quarkus-undertow?
I want to know to work with EJB entity bean. I must deploy EJB entity bean in ejb container.
But I have seen some projects my friends working use java persistence api with EJB entity bean,
but they are deployed in servlet container instead of ejb container.
OpenEJB should be integrated with tomcat (Nowadays, there is tomcat EJB compatible version, it is called tomEE)
See How to deploy EJB based application on Tomcat
Spring 3.2.0.M1 was released today with support for asynchronous #Controller methods. I'm trying to use this in an existing web app deployed as a war on Jetty. However, I've a few fundamental questions.
Do I need Jetty 8 OR this should run on Jetty 7 as well.
Is the async support build on top of Servlet 3.0 API or it is something that Spring MVC has implemented. In other words, do I need a Servlet 3.0 supported container for asynchronous controller to work.
On the topic of Jetty, servlet 3.0 support is in Jetty 8. You can not use jetty-7 as it implements only servlet 2.5 support. You can get async behavior in jetty-7 through jetty-continuations but that is not the same api as in servlet 3.0.
So that is 1/2 an answer only, I can't speak to the spring side of things.
Context: Using maven 3,spring portlet mvc 3.1
Background:
I have built a portlet using spring portlet mvc 3.1.
This portlet uses the spring portlet mvc defined Dispatched and is defined accordingly in the -portlet.xml.
The dispatcher portlet is configured to pass requests to the myController (POJO with annotation of #Controller)
I also have a service project (jar) which defines a business service to be used by myController. This service has its own spring file and defines the bean 'myService'
I want to inject myService into myController using a predefined bean, so I have defined ContextLoaderListener in the web.xml of my portlet project
Problem:
I have tried both ways of trying to inject myService into myController i.e. using annotations and xml defined beans, but the portlet fails on deployment with an error that myService bean could not be found (or when using annotations no matching bean with class type found)
Note: I can see some logs on undeploy that the beans are available, but I think the issue is with PortletApplicationContext (as defined by -portlet.xml) is loading before the root Web ApplicationContext (as defined applicationContext through default usage in web.xml)
Note2: If I put the import for spring file defining 'myService' bean into the -portlet.xml, then it works.
Would appreciate any help in sorting this out.
Using JDeveloper as my IDE, I have a web application which calls services provided by annotated EJB 3.0 beans packaged in third party jar. How do I configure the web application project to deploy the beans to the embedded OC4J container when I run the application?
The jar file is referenced by the project, and I have a META-INF/application.xml referencing those jar files as EJB modules. I've set the EJB Version property to 3.0, but the Annotated EJB 3.0 Bean Classes list remains empty, presumably because I have no beans defined in the sources of the web application I'm running. When running the project, the embedded oc4j container warns that the EJB module contains no beans. I'd like to deploy the beans in the jar file, but can't figure out how.
JDeveloper 10.1.3.4
Windows Vista
The answer came from an OTN Discussion Forum:
Re: Deploying third party EJB 3.0 jar in web application
Posted: Nov 2, 2009 8:15 AM in response to: user10375549
Hi,
We've used ejb-jar.xml to register EJB3 session beans from third-party jars in JDeveloer 11g TP4 (which was using oc4j). The only difference was that beside third-party beans we had our own session beans (which didn't need to be registered in ejb-jar.xml).
Here is how we did it
<session>
<display-name>MySessionBean</display-name>
<ejb-name>MySessionBean</ejb-name>
<remote>some.package.MySessionBeanRemote</remote>
<ejb-class>some.package.MySessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
I hope this helps you a bit.
Pedja