Missing Projects in eclipse Server - java

Installed Eclipse Galileo with Java EE IDE and configured Tomcat-6. There are several projects in workspace which i am not able to deploy with tomcat.
I right-click on Tomcat (in the Servers view) -> Add and remove... -> a window appears in which there are two textbox
1. available and 2. Configured.
i can not see any project in available text-box, Why ? is there anything i am missing to install/configure? Please see below the image

Your project are not typed as web app otherwise you would have a little globe on project.
Check your project facets

Related

Recovering Spring Boot Project in Eclipse

I'm running Eclipse Neon.2 Release (4.6.2) and was in the middle of a Spring Boot course when an Eclipse update killed my Workspace.
After many hours of research on -clean, eclipse.ini edits, etc I decided to start a new workspace. I have a local repo created on the HD and subclipse 1.10.13 plugin installed, so I knew my actual project was safe.
Problem is I can't get Maven to recreate the original structure of the project with the new project wizard (assuming this is what I need since a straight checkout was missing many directories/files. Using the wizard the structure is still off and it creates a duplicate pom.xml file.
How do I get Maven to recreate the structure the way it was without creating a duplicate pom.xml?
You can try to right click on your project, then from the context menu, click Configure > Convert to Maven project
Did you tried to start your Eclipse and Workspace with the start parameters -clean -initialize

Java EE deployment in Intellij IDEA

I have a fairly complex Java EE project which can be built fine from Maven. After importing it to IDEA, I had set up a working deployment of the frontend WAR and the backend EAR to a local Weblogic 12c server. The project also have several 'common' artifacts packaged as jars and used by both the frontend and backend artifacts. For deployment, I used the exploded artifacts to save some time on packaging/unpacking, everything works fine till that point.
During development, I edit some Java sources and try to redeploy the updated artifacts to the running Weblogic. I press Shift+F10, choose Redeploy artifacts, I see IDEA building the project, the project redeploys on the server, and more often than not, I do not see any of the recent changes. Even if I choose Rebuild project explicitly and then try to redeploy artifacts after, no changes can be seen on the server. The only safe way to make my changes appear in the deployed artifacts is to invoke maven from the command line calling the package goal, and then redeploying from IDEA. (No JRebel is installed, is being used either in the IDE or on Weblogic, and I'd like to stay that way).
Is that expected behaviour from IDEA? Could this be something specific to our project or something global? Should IDEA be able to discover which projects needs rebuilt and repackaged and then redeploy the EAR/WAR artifacts properly to the server? Does it need any help from my side achieving that goal?
Whats your run/debug configurations? Check this, if not already sois not.
in the quick menu, edit configurations > Run/debug configurations window:
Server tab:
On 'update' action: restart server
Before launch: set 'run maven clean' and 'run maven install'
Deplowment tab
inserts your ear's here.
don't sure this specific answer your question but what I can suggest you is to try configure
weblogic maven plugin
then you can execute deployment from command line / or from IDEA with maven support.
http://docs.oracle.com/cd/E21764_01/web.1111/e13702/maven_deployer.htm
http://www.youtube.com/watch?v=hagaMr6UL6U
Evenif your final goal is to do the whole built process done by IntelliJ build and deployment options I will first try the following:
If your project was set up properly in maven you should be able to load you maven pom.xml within you IntelliJ. All the maven build commands and deployment setting you were doing through mvn command line will show up in your IntelliJ's maven panel in a nice three structure.
If this works out then clearly one of the libraries that are built through your IntelliJ build are not being deployed properly into the right location. You need to narrow down which one of the jars, the ear, or the war has to be affected by a single change you make and then check whether the date of the file is updated in the location it is to be deployed or not.
To wrap up, my humble sugestion though is to use either maven or gradle intelliJ panels for your J2EE projects. As you do achieve the defined goal of having your project built completely through the IntelliJ idea. Also whatever plugin you add to your maven shows up in you idea's maven/gradle panel. It is a fairly straight forward approach and you achieve a powerfull and flexible deployment and build tools within IntelliJ like your wanted.

Using m2e plugin in a Dynamic Web Project

I have an existing Dynamic Web Project in Eclipse Indigo and the m2e plugin installed. In another version of my eclipse setup that I dont quite remember (my hdd crashed) I could just right click on the project -> Maven -> Enable Dependency Management.
This menu is gone for my Dynamic Web Project in my current eclipse version. Whats the way to go now? I tried right click on the project folder -> configure -> convert to maven project but that fails with errors.
M2Eclipse has migrated to an Eclipse project from Sonatype called m2e. Therefore in you Eclipse Indigo you have installed m2e whereas your old Maven projects in the older Eclipse version were created with M2Eclipse according to your right-click description. Now under normal circomstances everything should be working flawlessly and we wouldn't have this discussion. Unfortunately with the move of the project the namespace has changed from org.maven.ide.eclipse to org.eclipse.m2e.core and old Maven projects created with M2Eclipse are not immediately recognised as Maven projects in m2e. Here's a description of how to migrate your projects accordingly.
Erik, importing an existing maven project would let m2e discover and propose you to install m2e-wtp, the Maven Integration for Eclipse WTP plugin. Since you're starting from scratch, you should install m2e-wtp yourself (see https://github.com/sonatype/m2eclipse-wtp/wiki).
Now in order to quickstart a new mavenized web project, you should go to the "New Project" menu and choose new Maven project.
At this point, either you choose to create a "simple" project, in which case you need to select the "war" packaging on the following screen, or use a maven archetype, which will quickstart a new preconfigured web project, with the flavor you want (jsf, spring ...). The m2e-wtp wiki has links to help you get started.
Note : at this point Eclipse to Maven conversion is pretty much inexistant (only creates a bare pom.xml), that's why I recommend to create a maven project first. Hopefully, this should get better in the next m2e 1.1 (June 2012)

Problem with running Maven GWT application in Eclipse

I'm trying to create a GWT project through WebAppCreator enabled Maven2.
Project creation steps:
Create project with WebAppCreator (i'm using gwt-2.3.0) ->webAppCreator -noant -maven -XnoEclipse -out MyApp com.example.MyApp
Import project as existing maven project in eclipse (helios)
Enable "Project" -> "Properties" -> "Google" -> "Google web toolkit" -> "Use google web toolkit" checkbox
Set in project properties "Google" -> "Web application" -> "This project has a WAR directory". Set WAR directory path "src/main/webapp" and uncheck "launch and deploy from this directory"
Java build path is "MyApp/target/www/WEB-INF/classes"
I did not change the settings in pom.xml
Compile project using gwt eclipse plugin (2.3.0 version). It successfully compiled.
Try to run project as Web Application. When i run application GWT plugin does not ask me about WAR folder.
I did all this, I saw in the logs:
[WARN] Server class 'com.example.server.GreetingServiceImpl' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/home/redfox/workspace/java/redfox/MyApp/target/www/WEB-INF/classes/' to the web app classpath for this session
[WARN] Server class 'com.google.gwt.user.client.rpc.RemoteService' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/home/redfox/.m2/repository/com/google/gwt/gwt-servlet/2.3.0/gwt-servlet-2.3.0.jar' to the web app classpath for this session
And when i try to load page from URL (http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997) i see 404 error.
In logs i don't see any errors. How can i run this default application? Also i have another question: if this problev will be solved, how can i run this application in web mode (not in development mode) for using links like "http://127.0.0.1:8888" whithout param gwt.codesvr?
P.S. Sorry for my bad English.
I understand your frustration, trust me, I recently went through exactly the same issue you having now.
As Eugene indicated, follow his instructions, but...
On the Select an Archetype choose version 2.3.0-1 (Others may work but this one works for me)
Generate your sample app using theat Archtype version. Do a mvn gwt:run, you will see this screen (If all goes well)
Click on "Launch Default Browser".
Good luck.
Cheers
PB
I know this question is two years old. But i just had the same issue and now figured out how to fix it.
When eclipse doesn't ask you at the first launch for your "WAR" directory, you can also set it manually:
In eclipse go to "Run" -> "Debug Configuration...". Select your "Web Application" -> Select the "Arguments"-Tab and add the parameter e.g. "-war C:\YourProjectPath\target\YourProject-1.0-SNAPSHOT". Provide the full path here pointing to your target, generated by maven.
Hope that helps someone solving this issue faster :)
I know this is old, but here is my latest approach (as also answered here)
I can't speak for the webAppCreator because I haven't used it, but I have had good luck creating the Maven projects in Eclipse using the gwt-maven-plugin from codehause.
Creating a Maven GWT Project Directy in Eclipse
Open the new project wizard in Eclipse and filter on Maven Project.
Select the Maven Project and click next.
Enter the project location of your preference and click next.
Enter "gwt-" into the archetype filter and select the gwt-maven-plugin from codehaus. Click Next.
Enter your maven project details and a module value, then click Finish.
This will create a maven - gwt project for you in Eclipse. This comes with a sample application that you can use to make sure you can launch the application correctly.
Running the Application Command Line
Open command line.
Navigate to your project home.
Run the command "mvn clean package".
Run the command "mvn gwt:run"
This should get you up and running. If you used the 2.7.0 gwt-maven-plugin this should run the application in super dev mode by default.
Run the application in Eclipse
As you have done, navigate to Properties > Google > Web Application and check "This project has a WAR directory". The WAR directory using this plugin should be src/main/webapp.
Navigate to Properties > Google > Web Toolkit and check "This project has a WAR directory. You may be able to specify the module here. I am actually unable to do so, it may be specific to my Google Plugin for Eclipse or something environment specific...
Run As > Web Application.
If you had issues, as I have had, in step 2 then you will get an error Missing required argument 'module[s]'. To fix this open up your run configuration (should have been auto created) and in the arguments tab add the package qualified name for your module at the end of the arguments, e.g. com.mycompany.abc.GwtSampleModule. Do not add the ".gwt.xml" prefix.
It's worth also checking that the HTML page referenced in your arguments is correct, I have also had issues with that.
The application should now be configured for Launch in Eclipse using this run configuration. My verified environment is:
Eclipse Luna (v4.4)
Google Plugin for Eclipse (v3.8)
GWT Maven Plugin (v2.7.0)
What I suggest may start slightly different than you prefer but with better results :)
Install m2eclipse plugin. This will add a lot of nice maven features to your environment.
Using new project wizard create new Maven project
Do not select "simple project" check box, instead use the one of GWT archetypes (I suggest gwt-maven-plugin)
Then appropriate project structure with all required dependencies will be created for you by maven. More info about GWT plugin can be found at http://mojo.codehaus.org/gwt-maven-plugin/user-guide/archetype.html, including on how to execute it.
P.S. Your English is fine :)

Tomcat throws ClassNotFound exceptions for classes in other open eclipse projects

I have an eclipse project structure that looks something like this:
eclipse
project a
project b
All of these projects are Maven projects. Project B is an Eclipse WTP project and contains Project A as a dependency. I'm using the m2eclipse plugin.
When I deploy Project B to Tomcat (all from within Eclipse) it always throws errors saying that it can't find classes from Project A. The only way I can resolve this is to close Project A in Eclipse and do a mvn install command, so at this point Project A is treated like any other dependency.
I would like to not have to keep reopening and then closing Project A every time I make changes to it (which is pretty frequently at this stage).
I have tried adding Project A to Project B's Build Path, however that doesn't seem to do the trick. Again, it only works if I close the project in eclipse so it's treated like a normal maven dependency.
FYI I'm using the Helios version of Eclipse. Project B is a Spring project, so naturally Tomcat falls over when it imports all the beans etc.
Does anyone have any suggestions? Thanks a lot.
What you need to do is this:
In Eclipse go to Window > Show View > Servers > and open tab called Servers
In Servers, double click the server you want
This action should open a window entitled Overview, with your selected Server in the TAB
In this window select: Open launch configuration, and click the link.
In the Edit Configuration window, select the tab called Classpath
In the ClassPath textbox, select the line: User Entries
Now push the button on the right entitled: Add Projects
In the resulting Project Selection window select the external project you want the server to find via click.
Close these windows by clicking Apply then OK as appropriate as you work up the stack
Restart your server in the Overview window
You should be ready to go. It's actually only a 2 minute exercise. Good luck
If you go to the project properties, pick the item "Deployment Assembly", click "Add..." and choose "Project", you can add the dependent project and the issue should be solved.
The reason that tomcat cannot find your classes is that the project dependency in eclipse is not seen by tomcat. To resolve the issue you can add the bin folder of project a to the tomcat classpath of the app running from project b.
Right click on the web project which is added to container server and select Maven and then select Disable Workspace Resolution. Then your dependency project will start appearing as a jar like any other dependencies.
Right Click on the WebProject --> Maven --> Disable Workspace Resolution.
Have you installed the m2eclipse extension that know about WTP? Without it m2e will not work correctly for WTP projects. See this:
https://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto
Simple way :
Run -> Run Configurations... -> Classpath

Categories

Resources