I'm new to learning Java web applications and tomcat, and am having a slight problem setting up eclipse if someone doesn't mind having a brief look please. A search came up with a few fixes
You didn't create your project as "Dynamic Web Project", so Eclipse doesn't recognize it like web project. Create new "Dynamic Web Project" or go to Properties -> Projects Facets and check Dynamic Web Module
-
right click on project name in Package Explorer view.
select Properties
Select Project Facets
Click on Runtimes tab
check server
Click on OK
And now :
right click on server name in Servers view
click on Add and Remove ...
move resources to the right column
From my limited knowledge it looks like I've done what has been asked here. The project was also initially set up as a Dynamic Web Project:
The book I'm studying for also says that I should change the selected server in the project properties menu, as is suggested about, but I don't see the option:
Am I missing something obvious? Or did I make a mistake when applying this patch for tomcat 8.5? (described here)
Any help would be much appreciated. Thanks
*edit: RE the response asking for me to be more specific - I'm trying to use Tomcat with a new project. I've managed it in Netbeans before, but the book I'm working from has samples using Eclipse, and I'm just trying to make things easier for myself in the future.
Here's the section from the book that I'm following. (I've already gone Windows>Preferences>Server>RuntimeEnvironment>Add and added Tomcat v8.5 that I had to patch in).
I am trying to import a GUI project into my eclipse kepler on my Windows server 2012. After importing the package explorer looks like:
mygui.applet
mygui.swing.main
mygui.swing.main.dialogs
mygui.swing.main.events
Where as it should look like:
-mygui
-mygui.applet
-mygui.swing
Where my gui.swing is the parent package containing dialogs and events.
I tried importing the same project into another eclipse installed on a Windows 8 machine and it gets imported correctly.
Is this a problem of using eclipse on windows server 2012? Are there any pre-requisites I need to be aware of? Which other alternate Java builder can I use alternately on a virtual machine for a project of big size?
The method I am using to import my project is:
Create Java Project-> Import File System->Select Folder (This works on windows 8).
There is nothing wrong with your project. It's a preference in Eclipse. In the top right corner of the Package Explorer view is a downward-pointing triangle which opens up a drop down menu with an option called "Package Presentation" - this opens up a sub menu with the choices of "Flat" or "Hierarchical". You have "Flat" selected and need only to change to "Hierarchical" for the effect you desire.
I'm trying to create a descriptor file for my Java web application project.
For this project i am using:
Netbeans 8.0 &
GlassFish 4
When I try to create the glassfish descriptor file. Netbeans shows into the dialog window that is going to create a file called sun-web.xml instead of glassfish-web.xml.
I was looking for this on the internet and found that the first one sun-web.xml is created for version older than 3, and the version 4 should create a file with the name glassfish-web.xml.
I'm following a tutorial where a person is using the same tools that I have. But in the tutorial he can create a glassfish-web.xml file.
Another error raise when I click the finish button with the intention of create the sun-web.xml file and an error popup raise a show me this message:
"Deployment Configuration for this project not found. Deployment descriptor version could not be set properly"
Can't anyone help me please ???
Thank you a lot!!
You should be able to use that sun-web.xml file fine, it might change in a couple of ways like for example when you want to add a security role mapping, NetBeans won't be able to automatically fill in the security role names from your web.xml, but if you fill them in manually and correctly you should be fine.
Actually, I had the same problem, so what I did was erase all versions of Glassfish (I use OSX so I erased the folders from Applications > Netbeans > GlassFish and from Users/MyUser/GlassFish_Server), added a new server in NetBeans Services > Servers > right click add server and follow the wizard, when you get to step 2 (Server location) click download now and that will reinstall glassfish, restart NetBeans and now when you try to create a Glassfish descriptor it should be properly named as glass fish-web.xml
Hope this helps :)
I simply changed version Java EE 7 to Java EE 5 when creating new project at 3rd step Server and Settings and it could create glassfish-web.xml. I'm using same versions of Netbeans and Glasssfish. Hope may this will help you.
I had created a dynamic web project. AS of now it has a jsp file which am trying to run. When I tried to associate the project with a specific runtime(tomcat 6.0), it is not happening.
I right clicked on the project/properties/Targeted Runtimes. It doesn't show any runtimes(I have added tomcat 6.0 in servers). When I click the checkbox 'Show all runtimes', everything comes in disabled mode.
What could be the problem ?
Attached screenshot of the problem.
Update: I even tried to create a new runtime and associate it with the project( project/properties/Targeted Runtimes/new). Even the newly created runtime is getting disabled and am unable to associate it with the project.
To add a project to a runtime you must have a match between your project and your runtime; you have to check:
project facet: to run on tomcat it must be a Dynamic Web Project
java version: you can't run for example a java 7 project on a java 6 runtime
web project version: you can't run a project that doesn't match the Java EE version deployable in the runtime
Once you've validated the match between your project and the runtime, you need the project to target the runtime, as follows:
Open the project in Package Explorer, Project Explorer, or Navigator.
Right-click on the project, and select "Properties".
Click on "Targeted Runtimes" in the properties window.
Select the checkbox of the validated runtime that is to be targeted.
Confirm by clicking "OK".
The new runtime will be associated with that project. If a runtime that you want to select is not displayed or is disabled, you may need to uninstall one or more of the currently installed project facets. This can be done within the same Properties dialogue.
This is what worked for me. I'm just posting my method because it might help somebody else.
Right-click on project
Click on Properties
Go to Project Facets
Uncheck Dynamic Web Module checkbox
Click on Runtimes in the tabs on the right. Apache Tomcat vX.x should be available now
Check Apache Tomcat vX.x
Click Apply and Close
Repeat the previous steps 1-3
Check Dynamic Web Module checkbox
Apache Tomcat vX.x under Runtimes should still be enabled
Click Apply and Close
I know it's already answered question, but I like to share my solution with new users if I can help..
For me the problem was because of the Dynamic wen Project version,
3.0 work with java 1.7 ( I was using 3.1) . If it didn't work you can access .settings folder in your project,
org.eclipse.wst.common.project.facet.core.xml file
and set the version that you need.
<installed facet="jst.web" version="3.0"/>
Hope I can help new users
I have Found a fix for this problem.
Go to Preferences and Check your Targeted runtime, If No Runtime is displayed you can Configure it through Feacts. Select Dinamic Web module to 3.0 or 3.1
You can Also refer to this Video for Detailed Explanation. :
https://youtu.be/0W6s0hXbmNE
I have a Java Web Services project that was created in an older version of NetBeans, and I haven't accessed it in many months, so my paths and installed libraries are different.
When I try to open the project, I get a "Resolve Reference Problems" dialog, and two Reference Problems are listed:
"metro" library could not be found
"JAX-WS-ENDORSED" library could not be found
I have a fresh installation of JDK 6 Update 25 with NetBeans 7.0, and am running Windows 7.
What steps can I take to solve this? I don't even know where to start, as every approach I've taken so far hasn't gotten me anywhere.
Note: JAX-WS-ENDORSED does not appear in my Libraries listing, so I can't remove it. Something hidden is referencing it. How would I find this?
I just came across this issue and found some help from http://netbeans.org/bugzilla/show_bug.cgi?id=187145. Apparently, Netbeans will create the JAX-WS-ENDORSED library when a new web service is created. So go to File > New File, choose Web Service > Web Service Client and fill in dummy values (this can be done in a throwaway project). This client can then be removed, and Netbeans will have created the library with the following classpath entries:
java/modules/ext/jaxws22/api/jaxws-api.jar
ide/modules/ext/jaxb/api/jaxb-api.jar
These are relative to your Netbeans install directory (on OS X will be located in Contents/Resources/Netbeans within the .app). Alternatively, you could create the library manually using the entries above.
This only needs to be done once, as the library will be added to Netbeans Global Libraries list.
The best solution is to edit project.properties file and replace below piece of code.
Original property: endorsed.classpath=\${libs.JAX-WS-ENDORSED.classpath}
Replace with: endorsed.classpath=\${lib.JAX-WS 2.2.classpath}
In older versions of Netbeans there is JAX-WS-ENDORSED library in libs location.
Newer versions of Netbeans having JAX-WS 2.2 library in lib folder
** ALL THE BEST **
If it is still needed, I had the same situation when opened a netbeans 6.9 project in netbeans 7. There is no way to resolve the 'jaxb-endorsed' (in my case was jaxb and not jaxws) reference using the libraries window.
I found a endorsed.classpath property in the nbproject/project.properties file.
I still not sure what is its purpose, but in this property I found the bad reference to jaxb-endorsed.classpath, so I deleted, closed netbeans and opened again, and the reference problem has gone.
I already have Jaxb 2.2 library added to my project, so it is working good with the modification I did to the project.properties.
I hope it helps.
I had a similar problem : DO NOT DELETE THE JAX-WS-ENDORSED - remind me to downvote. I had to go to the imported project > resolve reference
problems dialogue > delete the references from there which were pointing to the old NB folders - pic :
and then create the throwaway web service as suggested by William Scott and then add the newly created jars :
Netbeans maintains a set of libraries, which are simply a convenient way to manage groups of related jar files. Start by clicking Tools > Libraries. You will see the library manager window.
You will see the options to add your own libraries if you have jar files downloaded. If you do not see the library that you are looking for you can download them and add them your self. Once the library exist in Netbeans you can go to the Project Explorer window and right click on the Libraries tab of your project. Select Add Library and you will have the chance to add the library that you added in the library manager.
You may want to right click on your project, go to properties -> Libraries.
Remove the JAX-WS-ENDORSED library, and try using JAX-WS 2.2
Also remove metro and try adding METRO 2.0
That may solve your problem.
You may also want to right-click on your web service references and select
Edit Web Service Attributes
Then on wsimport Options tab see if xendorsed is set to true.
UPDATE
You may need to close netbeans and then open it again, and it may work. I was having a problem similar and I just did that and it worked.
The only difference, and it may not be needed, is that I also added the JAXB 2.2 library, but that was because I was trying to solve a compilation error.
I had same problem and Fix it by install soap webservice and and resful webservice in netbeans plugin
I fix it:
unistall netbeans.
delete HOME/.netbeans and HOME/.nbi
then install netbeans again
Old thread, different and effective solution... I just moved some projects from one system to another and got this error. With NetBeans v7.3+, go to Tools>Plugins, Available Plugins, then search for "SOAP". You should see "SOAP Web Services". On loading this library you'll get the JAX-WS-ENDORSED library. Restart NetBeans and you should be able to get a Clean Build.
Loading this package brings in a number of other libraries. On restarting the IDE you may get a notification that other packages now have available updates.
Do the following ( BTW in my case its NetBeans 6.9.1 )
1 Why this appeared now ?
Because i tried to open project on other pc with fresh copy of net bean
2 How the problem looks like ?
Jar Lib Not Found for JAX-WS-ENDORSED
3 Why it was needed at the first place and what its used for?
Well i have a webservice on same server/domain e.g localhost , so of course
it will work if i removed the web service from the folder in sources but i need it
4 What to do?
Try to add dummy any online free web service in form wsdl
like Some test web service or search for any other one
This is the source of my public free to use wsdl
5 What then ?
Just add it please
Now what ?
Wait for scanning project stuff it should be ok
you can re check from library properties of project
or see that there is no red/ or resolve references problem
in project properties
So what happened exactly?
Note: JAX-WS-ENDORSED it will be added automatically to your libraries
same methodology can solve other problems as well