EAP application using Eclipse - ejb-3.0

I have created a sample EJB Project and a Dynamic project.
Now I have used the interface of EJBProject inside the client project so that it could use the proxy object and in turn interact with the bean to fetch the data.
However, I have created a blank EAP project and have added both the EJBProject and the DynamicWebproject. Now according to the concept I have bundled the EJB and Web inside EAp and have deployed on JBoss Server, so technically if I hit the jboss url then it should direct me to welcome page of client. However I am not getting as expected.
Am I doing any mistake in deploying it??

When you will deploy EAP then a target must be generated in that target you will have application.xml in that you will have context root now use this context root in your url foreg: localhost:yourport/yourprojectname/contextroot
this must take you to your page

Related

Deploy Spring Boot project to WebSphere 8.5.5

I'm trying to deploy my spring boot project (made by spring initializr) with maven (but same issue with gradle) on WebSphere Application Server 8.5.5 but it seems impossible to me.
Every-time I try to add to server from "Add and Remove" it says "There are no resources that can be added or removed from the server".
So I tried changing Dynamic Web Module on Project properties --> project facets but nothing changed.
Is it possible to deploy on WAS 8.5.5?
I found a similar reported issue here: Cannot 'Add and Remove' Maven Project with Websphere 7 on RAD 8.5.
I completely removed my project from RAD. I then extracted zip file from Spring Initializr to create a Maven project. I used "mvnw eclipse:eclipse" command and it successfully created build. I imported that as a general project to RAD.
I then clicked on project. Clicked on properties. Clicked on project facets. None were available, but it prompted me to create them and I did. From there, I selected Dynamic Web Module facet (and also JAX-RS, but I'm not sure if you'll care about that one). I clicked apply and close.
After this, I was able to add and remove resource to Websphere server. I don't know if this is preferred steps or not. I am learning, just as you are. But, it appeared to work.
I specified Java 8 Jar in Spring Initializr for packaging. Maven version is 3.8.4. Spring Boot 2.6.5 (it was pre-selected for me). I am using RAD 9.7 and Websphere server that is stood up in IDE is version 8.5.5.
To deploy spring boot to WebSphere 9 you would want to choose War packaging and Java 8. The zip file from the spring initializr includes a Help.md file with links to helpful documentation. After you extract the zip file, use File -> Import existing maven project into a new workspace.

Is there any way we could figure out in code the environment where EAR is deployed?

I am facing an issue in my restlet project where I have to code some operations only if the EAR is deployed in Websphere in a restlet server project. Is there any way we can get information through code to find out where is EAR/WAR deployed? (Is the EAR is deployed in Websphere or Tomcat or other servers).
Try to instantiate some WebSphere API class. If you get a NoClassDefFound, it's probably not running on WebSphere. You might have to do class.forName(Websphere class), so your code will compile outside websphere.
If you only need to check that for example in Servlet/Filter class you can look for servlet context attributes related to WebSphere, for example com.ibm.websphere.servlet.application.name = Default Web Application. You can find some attributes looi=king at the /snoop servlet if you have that installed.
Or, as Bruce suggested try to load some WebSphere class and be prepared for errors when they are not there.

Netbeans 8.2. Maven webapplication won't run on Tomcat but will on Glasfish server

I am developing a simple restful server and want to deploy it on a Tomcat server. When I deploy the project it won't run and gives me the message: http 404, The requested resource is not available.
The project is a default, newly created Maven project and when I select Glasfish it runs fine. Can anyone give help me to find out what I am doing wrong?
I found the problem myself. For anyone struggling. Java Jax-RS doesn't run default on Tomcat. You need Tomcat EE or add EE to Tomcat.

Where to install JDBC driver for Vaadin app run from IntelliJ using bundled Jetty servlet container?

I will ultimately be deploying my Vaadin web app to Tomcat servlet container.
In Tomcat, JDBC drivers generally need to be stored outside of the web app, in a separate Tomcat folder. So I do not want to add any JDBC driver as a dependency within my Maven build settings.
In the meantime, while developing I am running the Vaadin 8 or 8.1 web app (created from the vaadin-archetype-application Maven archetype) from within IntelliJ 2017.1 using the Jetty servlet container that is somewhere mysteriously bundled (“embedded”?) within the project.
Where can I store my JDBC driver jar file(s) while developing with IntelliJ-Jetty combo?
This depends on wether you use Tomcat or Jetty as an "old fashioned" appserver, or if you use it as an embedded component in your application. The archetype you have used probably assumes the latter (adds jetty-plugin to pom), while it sounds like you want the first scenario. In that case, just install the driver in the tomcat or jetty instance you want to use, and create a run configuration in IntelliJ for that instance. If you need the driver compile-time, add it to the pom with scope "provided". If you want to just have it available to the jetty-plugin, add it as a dependency for that plugin (inside the plugin definition).
See this related question for more info about including dependencies only for embedded jetty.

Spring Injection not working between Ejb jar and WAR in websphere liberty server

I am migrating websphere application server to websphere liberty server. We are using enterprise application , which contains EAR with ebj module and WAR (web application) developed using spring , some classes from ejb module and injected in WAR module, the classes are able to inject without any issue in websphere server but this architecture is not working in liberty server. I am getting null for injection properties. Do i need to do any additional conifiguration for liberty sever. Thanks
EAR
|- helloworldejb.jar
|
|- helloworldwebapp
Thanks,
Siva Kumar
Actually in liberty server the EAR/WAR applications are lazy loading which means the application will load only when the request receives which is not in the case of Websphere application server. So here the required injection properties are injected in WAR level and the WAR module will only load when request receives and then inject the properties. So for the first time when EAR module receives the request , WAR module will not load during this time, . If we want to stop lazy loading then we need to have the below configuration in sever.xml , which helps to load all the initialization during startup of the server. Find the below configuration details and documentation related to the configuration.
Config details :
<webContainer deferServletLoad="false"/>
URL :
http://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_servlet_load.html

Resources