EJBs are getting duplicated in weblogic 12c using EAR deployment from jdeveloper 12c - ejb

My project consists of 2 modules webapp + jar(ejb module), when I tried to run this app from jdeveloper 12c deployed to integrated weblogic server, the server is identifying all ejb beans as twice, one from war and other from jar. Any guess how this happens?

If your application is deployed as EAR, the EAR probably contains the EJB JARs within the WAR and the EAR.
If not, you are probably deploying the WAR with the EJB JARs inside AND the EJB JARs at the same time as multiple deployment.

Related

Can you deploy a message driven bean packaged as a EJB JAR on Weblogic?

Hi I am new to Weblogic and I am trying to figure out how to deploy a MDB properly. I have an EAR project that contains my Beans and config files, am I able to export that as a JAR and deploy that onto the Weblogic server?
EJB's can be deployed as JARs (see oracle docs section "Using Archived Files")
and the jar should contain the deployment descriptor xml / Annotations (e.g. #MessageDriven ) that configures the MDB.

java EE project encountered NoClassDefFoundError

I am working on a Java EE project with
jdk 1.8
wildfly 10.1.0 final
intellij idea 2016.3
The project has a web application module and an ejb module, and the structure is as follows:
And the two modules have already been deployed successfully
But when I tried to call the session bean, the ejb project went wrong and threw an error
Caused by: java.lang.NoClassDefFoundError: org/json/JSONArray
I use JSON in class DAOHelperImpl in the ejb module, and I've already add the dependency. I tried to put the jar in various packages such as /ejb/lib or /web/web/lib, but none of them are working.
What's wrong?
Move the jars libraries from /web/web/lib into
/web/web/WEB-INF/lib
By Convention the general folder for auto included jars is:
web-project-name/webContent/WEB-INF/lib
Read more here: https://blogs.oracle.com/alexismp/entry/web_inf_lib_jar_meta
I am not aware how IntelliJ handles Java EE projects.
In Eclipse the EAR and WAR are in separate projects and can be assigned to each other.
I think this error is raised due to my bad understanding of how this web application together with the ejb module works: I deploy the web module and the ejb module separately, and it seems that wildfly can only link to the lib of the web module.
The solution is to deploy only the web application to the server and add the ejb module to the web application.

Tomcat with in eclipse not recognizing the non web.xml app

I have created Spring MVC application without web.xml, completely using the java configuration but when I right click on the project I am not getting an option as Run on server which usually helps me to deploy my war into Tomcat 8.

Why AEM as war file?

Adobe Experience Manager is downloadable in two format: either as a standalone jar File(which has Apache Felix as the OSGi Container, CRX as the repository, Apache Sling for content delivery and it's own Servlet Container which i believe is jetty nowadays).
and also as a war file. apart from the application server part, this war file has all the other elements and war is deployed on say WebSphere or Apache Tomcat.
i don't seem to understand what is advantage of having AEM as a .war file when a standalone jar will do the work.
Thanks
Some users want to use war files as that's what they are used to in their environments, but you are right that the runnable jar does the job just fine, with a simpler environment.
with a war file, we can deploy it to EJB server like Jboss

Deploying remote EJB and Web application

I have successfully deployed an EJB 3 module and a JSF WEB app which calls the EJB module's beans using netbeans IDE locally. Now when I try to deploy this in staging environment, i get the following error:
root cause
javax.servlet.ServletException: com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.store.managedbeans.CustomerManagedBean/customerService#jndi: com.store.service.CustomerRemote#null#com.store.service.CustomerRemote#Session#null into class com.store.managedbeans.CustomerManagedBean
root cause
javax.naming.NameNotFoundException: com.store.service.CustomerRemote#com.store.service.CustomerRemote not found
I have deployed the EJB module and Web application in glassfish v2 (in the staging environment).The jar of the EJB Module is inside WEB-INF/lib folder of web application. It looks like the web app cannot find the EJB module. The classes are annotated with #Remote. And I am calling interfaces and not the bean by using #EJB. And of course, this worked find when I deployed it under Netbeans.
From the comments:
The EJB Module was referencing a JMS Queue Connection Factory. The resource hadn't been created in the staging glassfish server. Although the EJB module was allowed to be deployed, the JNDI Log from the console reveals that none of the EJBs were bound to any names because of a problem in deploying the module.

Resources