I found in Why won't the New Server Runtime dialog recognize my Linux installed version of Tomcat? that:
When identifying Tomcat 5.0.x, a servlet-api.jar is expected to be
present in the common/lib directory.
but my problem is I have a slightly modified Tomcat 7.0.30 and WTP thinks it's 5.1
Where can I find a list of actual checks per Tomcat version?
Looks like the anwser is here: https://github.com/eclipse/webtools.servertools/blob/master/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatVersionHelper.java
Funny thing, they don't inspect the external file CATALINA_BASE/lib/org/apache/catalina/util/ServerInfo.properties as described in https://tomcat.apache.org/tomcat-7.0-doc/security-howto.html
Related
Can anyone give me some advice on this error?
Whenever I try to define a new server on eclipse by using tomcat, I get this error:
Could not load the Tomcat server configuration at C:\gwl\web\apache\conf. The configuration may be corrupt or incomplete.
My Tomcat version is 8.5
Don't use an installed copy of Tomcat. Your user does not have full ownership over its file tree, and the installation layout might have other unanticipated differences. Get a tar/zip file from Apache, or on more recent versions, let the wizard download Tomcat for you.
I'm trying to connect a weblogic server to my eclipse (photon) and I keep getting this error message:
Error
"does not contain a valid WebLogic Server install or the installed version is not supported"
I've tried installing 3 different types of eclipse (Photon, Eclipse IDE for Java Developers - 2021-09 and Eclipse IDE for Enterprise Java and Web Developers - 2021-09) but I have the same error on all of them.
I know that I have configured the weblogic server correctly because I can access it as shown:
Weblogic Server
Shouldn't it be looking for the startWebLogic file or something? Because that's where I'm pointing it at.
I have tried doing what other threads do but they don't work for me.
Basically I have 2 questions:
How do I fix this error?
What file does this pop-up is looking for?
The WebLogc Home Folder must set to point to your WebLogic installation and not to a domain folder (as you did). Locate the wlserver folder under your WebLogic installation and set it up in Eclipse.
You have to look to the "wlserver" folder, I just got it fixed, also with Oracle 12c.
The Server I linked was: C:\WL\wls12213\wlserver
And then you can continue, also the configuration guide will ask you for the domain, that you have to had already configured.
In my case: C:\WL\weblogic_server_12.2.1
I'm using Spring Tools Studio 4.6.1
I have a wsdl file for the Web service. I want to test the interaction between the client and the server. To do this, I run the mock server with embedded grizzly.
The question about of implementing mock server. I generated an interface from wsdl (and xsd) using the wsimport and wrote implementation. When run on the grizzly, I get the following error:
com.sun.xml.ws.server.ServerRtException: [failed to localize] cannot.load.wsdl(META-INF/wsdl/test.wsdl)
I run a web service with this code:
HttpHandler httpHandler = new JaxwsHandler(new TestImpl());
server.getServerConfiguration().addHttpHandler(httpHandler, "/test");
The problem is that Grizzly can not find wsdl and xsd files. In embedded glassfish its work.
EDIT1
I change wsdlLocation to "test.wsdl" and its work. But now grizzly say:
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
EDIT2
If use JDK1.7 it works. But I need a JDK 1.6
I'm not sure why you're seeing that error. I can run the Grizzly jaxws example and obtain the wsdl using either 1.6 or 1.7.
I would recommend reviewing the source1 of the example and compare to what you have.
I'm change the jdk6 to jdk7 and works fine! Don't forget to change the JAVA_HOME and the default JDK of Netbeans as related here: How to set the JDK Netbeans runs on?
Your version of Grizzly expects a JAX-WS 2.2 API while JDK 1.6 ships with JAX-WS 2.1. As others mentioned, some of these files need to be installed into an endorsed directory. You can download the required files here or take them from your Grizzly installation. The download includes an Ant build file that provides a build target to install the files into the JDK endorsed directory. You can run it with ant install-api. If you cannot run Ant, you may install them manually:
cp lib/jaxb-api.jar $JAVA_HOME/lib/endorsed
cp lib/jaxws-api.jar $JAVA_HOME/lib/endorsed
Do not install other files from the JAX-WS distribution into the endorsed directory unless you want to create some really difficult to debug bugs for yourself.
I am suggesting to use the endorsed directory in $JAVA_HOME/lib/endorsed because that will work with most tools and applications without any additional changes. Others already suggested more targeted changes, such as setting an endorsed directory during a Maven build or copying the files into a Tomcat endorsed directory. All these approaches are fine as long as you can make sure that your code is picking up the right endorsed directory.
As a result, we had to use endorsed mechanism. Documentation
create a folder called endorsed and put these jar files in it
1.jaxb-api-2.2.jar
2.jaxws-api.jar
put the folder in tomcat server as
C:\tomcat-7.50\< created folder>
and run it will works
Changing JDK from 1.6 to 1.7 worked for me.
This question already has answers here:
How do I import the javax.servlet / jakarta.servlet API in my Eclipse project?
(16 answers)
Closed 1 year ago.
Every thing was fine and i was able to run this JSP project,
suddenly some thing happened and mostly all my servlets getting unresolved error.
I know its because specific JAR file cant be found for compilation.. but my "buildpath" is fine and i didnt make any changes..
I am stuck in this situation...
Tried
cleaned project many times
removes and added JRE library
removed and added server(Tomcat 7.0.23)
You have to set the runtime for your web project to the Tomcat installation you are using; you can do it in the "Targeted runtimes" section of the project configuration.
In this way you will allow Eclipse to add Tomcat's Java EE Web Profile jars to the build path.
Remember that the HttpServlet class isn't in a JRE, but at least in an Enterprise Web Profile (e.g. a servlet container runtime /lib folder).
It means that servlet jar is missing .
check the libraries for your project.
Configure your buildpath download **
servlet-api.jar
** and import it in your project.
A simple solution for me was to go to Properties -> Java Build Path -> Order and Export, then check the Apache Tomcat library. This is assumes you've already set Tomcat as your deployment target and are still getting the error.
It happened for me also and the reason was selecting inappropriate combination of tomcat and Dynamic web module version while creating project in eclipse. I selected Tomcat v9.0 along with Dynamic web module version 3.1 and eclipse was not able to resolve the HttpServlet type. When used Tomcat 7.0 along with Dynamic web module version 7.0, eclipse was automatically able to resolve the HttpServlet type.
Related question Dynamic Web Module option in Eclipse
To check which version of tomcat should be used along with different versions of the Servlet and JSP specifications refer http://tomcat.apache.org/whichversion.html
None of the recommendations I found on the web resolved for me, not even the ones here in this conversation.
The only thing that did resolve was uninstalling Tomcat 10 and installing version 9, then the issue was gone. I took this (http://tomcat.apache.org/whichversion.html) into account, but that didn't seem to have anything to do with my issue.
I faced the same problem in eclipse with tomcat7 with the error javax.servlet cannot be resolved. If I select the server in targeted runtime mode and build project again, the error get's resolved.
I have Tomcat 6.0 installation on my Win7 PC. I used 64/32bit windows installation.
In Eclipse I was able to set paths and set server to use my Tomcat installation. Everything seems working fine until I run server from inside Eclipse.
I noticed that http://localhost:8080/index.html page is not available (Tomcat default home page). I also can't access http://localhost:8080/axis2. I have Axis2 installed too.
Since I am struggling to make simple axix2 web service for long time, I am thinking maybe this Eclipse instance of Tomcat is adding to my issues?
When I start Tomcat from windows GUI everything works as I expect.
Any ideas?
Thanks.
Eclipse does by default not take control over the Tomcat installation and all of its pre-deployed webapps, instead it just uses its sole server engine and uses the workspace metadata as deploy space. When you start such a server configuration from inside Eclipse, all of the pre-deployed webapps will just be plain ignored, including Tomcat's default homepage.
To let Eclipse take control over the Tomcat installation, you need to doubleclick the Tomcat server entry in Servers view to get its configuration, then at the left column, under Server Locations, you need to select Use Tomcat installation (note, when it is grayed out, read the section leading text! It needs to be published without any projects).
Yes, this is normal. In the Package Explorer, you can click the Servers folder and view the configuration files that the Eclipse instance is using, specifically server.xml and context.xml. You can edit this configuration to match your specific requirements.
You may also want to check out the section titled Tomcat Publishing Options in this link here: http://www.eclipse.org/webtools/releases/2.0/newandnoteworthy/server.php
I favor this approach because when WTP inevitably corrupts my configuration once every two weeks, I don't have to reinstall Tomcat, I can just delete the server and reconfigure it.