Eclipse not showing project for the server - java

I have problem with the Eclipse and the servers... I had installed the Weblogic server and after configuring everything I was able to see the projects when I clicked on servers and try to Add and Remove. But later I needed to install also the Tomcat and for some reason after that I was not able to see the projects there... I removed the Tomcat, but it did not solve the problem. Also I've:
Configured the project facet to use Dynamic Web Module and Java.
Selected Weblogic in Targeted Runtimes.
I checked if Java runtimes are the same for each project and also the server.
I compared the properties and configurations of each project module of the same project on another PC. It looks the same. And on other PC it works. On mine it also worked at the beginning. What is more, the configuration of the project on this other PC was prepared based on my configuration in Eclipse...
I don't know what I should do to make it work again... Maybe some hidden configuration files or properties? I don't know...
BTW what will happen if I would remove this folder:
.metadata\.plugins\org.eclipse.core.resources\.projects ??
Some information:
Server Oracle Weblogic 12c
Tomcat no longer needed, so has been removed
Eclipse Neon 4.x (I will update this tomorrow, because I don't remember)
Runtimes set up for JRE 7
Maven project devided into submodules: 2 ears, each contains 1 war, both wars contains common 2 jars.
EAR projects has EAR 6.0 in facet configuration
WAR projects has Dynamic Web Module 3.0, Java 7, JPA 2.0 (probably) and Javascript in facet
JAR projects just Java 7
There is also other Gradle project, the front-end one, which looks like that: EAR which contains the WAR
Here in facet is also the same situation like with Maven projects

Related

Create a Gradle 7.x Java web application project in Eclipse 2021-03

I use Eclipse and Gradle for a few "desktop" / command line Java application projects, including multi-project projects.
But I haven't used Gradle for a Java web application project in Eclipse so far. My usual approach is:
Create empty workspace and configure it (JDK, Runtime environment Tomcat server)
"Create a Dynamic Web project", run through wizard
And everything works fine. The project has a proper structure (WEB-INF exists, web.xml is created etc.), it compiles and it is deployed automatically to Tomcat by Eclipse. CATALINA_BASE is set to some temp folder in the workspace.
But how do I create a Gradle project which is a "Dynamic Web project" and not just a command line Java application or java-library?
I have tried two approaches:
Create a Gradle project using the wizard in Eclipse. It seems to create a java-library project always with a lib subproject. Having created the "wrapper" project and the actual Gradle project lib, set java and war as plugins for this. Open the project properties of the Gradle project lib, Project Facets, add Dynamic Web Project Facet (4.0). Create run configuration to make it run in Tomcat server.
Create a Gradle project using gradle init in an empty directory. Create application project instead of library. Import that existing Gradle project into an empty workspace (instead of using Eclipse to create the project). And apply the same procedures as above (facet etc.).
None of the approaches gave me a working, ready-to-use web application project that has the expected folder structures (WebContent, WEB-INF, ...), that deploys correctly (no deployment or e.g. web.xml missing) ...
I spent several hours to use Gradle in a Java web application project in Eclipse. (Because I want to profit from its easy declarative dependency management.) But I didn't manage to make it work.
Also the samples in the Gradle docs do not contain a Java web application project:
https://docs.gradle.org/current/samples/index.html
Only Java Application or Java Library.
Has someone else already managed to set this up?
Gradle 7.0.x
Eclipse 2021-03
Tomcat 9 or 10 (I've tried both)
AdoptOpenJDK 11
Windows machine
Please share your approach. :)

Rational Developer Application 9.1 Websphere 7.0 there aren't resources to add or remove

I work with Rational Developer Application 9.1 for Websphere 7.0.
I downloaded a project using SCM Harvest plugin for RAD.
I have two projects. One of them is a EAR.
After downloading, I did some modifications in java classes and I want to build the project. I have disabled build and clean options
When I click add or remove in the websphere server, I get the error
"There aren't resources to add or remove"
How can I fix these errors?
The tools allows you to add Java EE modules to the server. However, based on the screencap that you have, the project is not imported as Java EE projects and thus the tools won't allow you to add those projects to the server.
It looks like vaiEAR is already an Eclipse project before and based on the list of metadata file, my guess is it was an EAR project before. If it is, you can try to do a File > Import > General > Existing Projects into Workspace and point to the root directory of your vaiEAR (and do the same for the child modules.
After that, you should be able to see the EAR in the add and remove dialog.

Deploying to Weblogic 10.3.6 from Eclipse -- "There are no resources that can be added or removed from the server."

I have a Spring Boot application. I build it with Maven. I have the pom configured to produce a Weblogic-compatible .war file. I can deploy this war file manually via either the WebLogic console or via the weblogic-maven-plugin Maven command.
I have now added my WebLogic server and domain to my Eclipse servers panel. I can start and stop it just fine, but when I click "Add and Remove", I get:
There are no resources that can be added or removed from the server.
In my Project Facets, I have:
Dynamic Web Module 2.5
Java 1.7 (matches what WebLogic wants and what my pom specifies)
What else can I check or change?
Sometimes the problem might also because you did not select the dynamic web module .
To do so open your project properties then goto your Project Facets then Check/Select the Dynamic Web Module checkbox then apply & close.
So, even though I didn't have the Cloud Foundry facet checked, that was still the issue. I deleted the Cloud Foundry-related plugins from Eclipse, and it started working.

Eclipse: XDoclet Plugin is setting wrong ejb-client-jar in ejb-jar.xml

I am working with an old Enterprise app which uses EJB 2.1. The app was build in 2000s using Eclipse and XDoclet 1.2.3.
The app consist of 1 Enterprise Application Project named AppEar, 1 EJB Project named AppEjb, 1 EJB Client Project named AppEjbClient, 1 Utility Project named AppSrc and 1 Dynamic Web Project named AppWeb.
The ejb-jar.xml is located in ejbModule\META-INF folder of AppEjb project and points to AppEjbClient project by having this entry :
<ejb-client-jar>AppEjbClient.jar</ejb-client-jar>
I upgrade the app to Eclipse Kepler (My workspace is D:\WORK\WORKSPACE-eclipse-jee-kepler). But the issue I am having is XDoclet Plugin is now setting wrong ejb-client-jar in ejb-jar.xml. This is how it is setting now:
<ejb-client-jar>AppSrc.jar</ejb-client-jar>
So somehow the XDcolet plugin is now thinking that AppSrc is the EJB Client Project instead of AppEjbClient.
I investigated a bit and find that the XDcolet plugin runs the ant script tempAnt.xml which is located in .metadata\.plugins\org.eclipse.jst.j2ee.ejb.annotations.xdoclet folder of the workspace. That folder also has a build.properties file which has 2 properties related to the EJB Client Module:
ejb.dd.clientjar=AppSrc.jar
ejb.client.module.src=D:/WORK/WORKSPACE-eclipse-jee-kepler/AppSrc/src
I thought I just need to change them in build.properties file to point to right EJB Client so I change them this way:
ejb.dd.clientjar=AppEjbClient.jar
ejb.client.module.src=D:/WORK/WORKSPACE-eclipse-jee-kepler/AppEjbClient/ejbModule
Save the build.properties file and then do clean and build the whole workspace again.
But still got the same wrong ejb-client-jar in ejb-jar.xml.
Check the build.properties file in .metadata\.plugins\org.eclipse.jst.j2ee.ejb.annotations.xdoclet folder and it was reverted back by removing my changes. So XDoclet Plugin overwrites this file.
How can I fix this so it pick the correct ejb-client-jar in ejb-jar.xml?
We run in the same issue recently. The way to overcome this was to remove the Utility Project from the eclipse workspace, as dependecies were resolved via maven poms anyway.
After that, the client under Java EE Tools > Remove EJB Client (and thus in ejb.dd.clientjar) was set correctly.
Probably some bug similar to this https://bugs.eclipse.org/bugs/show_bug.cgi?id=122274.

Eclipse Maven Spring: Server Error when I try to Run As Server (Tomcat 7)

I have a Java project using the Spring MVC framework and Maven as its build system. The primary IDE I wish to use is Eclipse for Java EE. I am using a standard Maven project structure for my application: source code is in src/main/java, resources for the application are in src/main/resources and code related to the web container are in src/main/webapp. In src/main/webapp/WEB-INF, I have a web.xml file for configuring my server and multiple folders for Spring-related files, such as context XML files and views. These Spring files are linked to legally in web.xml.
When I try to run the project using the Maven-Tomcat7-Plugin (via the mvn tomcat7:run-war goal), my project launches successfully and I am able to view my web pages and see my REST controller in action without issue.
However, when I try to run the project in Eclipse, using its Run As Server option, it never works and I have no idea why not. I keep getting an error dialog box titles Server Error and with the message The selection cannot be run on any server. I have already configured a Tomcat 7 server runtime legally in Eclipse; I can use this runtime without any problem for my other Java projects. I have tried everything that Google, Stackoverflow and blogs suggest to get an Eclipse Maven Spring project working on an Eclipse server. I've tried to delete the Eclipse project, delete the Eclipse-workspace files and reimport the project (both as a Maven project and as a regular Java project), but to no avail. I've also tried enabling the Dynamic Web Module in the Project Facets and setting the web directory to src/main/webapp, but also to no avail.
I'm baffled; I've worked with Tomcat servers in Eclipse many times before but it is just not working for this specific Spring project, even though it deploys just fine on Tomcat using Maven. Does anyone have any idea what might be going wrong? Have I forgotten a trouble-shooting step? Is there something wrong with my project setup that is conflicting with what Eclipse expects in a Web Server project? Thanks in advance.
I think I figured it out. There may be a bug in Eclipse's Dynamic Web Module, version 3.1. My project was being imported using this version because I am using version 3.1 of javax.servlet-api in my pom.xml. When I changed the version down to version 3.0, I am now able to run it as a server.
Basically, to do this change, I had to go into the .settings/org.eclipse.wst.common.project.facet.core.xml and change the <installed facet="jst.web" version="3.1"/> tag to instead be <installed facet="jst.web" version="3.0"/>.
Time to file a bug with Eclipse...

Categories

Resources