I have a problem when using Tomcat 8.5 with Eclipse. If I comment a java method, I get the error below, and also if I restart the server I cannot get synchronized. The only way to get synchronized is to restart Server.
I am using:
- tomcat 8.5.x
- Eclipse mars 2
- Java 8
- Tomcat manager plugin for eclipse, i cannot add tomcat server as usual because of the architecture of the project.
Any suggestion to solve de problem?
I am responding because I have found the solution.
First of all, the best practice is to created a Dynamic Web Project as suggested, but due to economic reasons (current architecture is installed and configured on a large number of servers and mantained by different prsons) we cannot change it.
The problem was in a class using a native Sun package and the use of the class JPEGImageEncoder that was deprecated after Java 6. Removing the use of that class and configuring ant to use java 7 and downgrading the jdk configured in Tomcat Manager Plugin from JDK 8 to JDK 7, after the deploy, the problem disappeared.
Related
I have downloaded and installed tomcat 9 to my machine, but on Eclipse > Window > Preferences > Server > Runtime Environment, after clicking on Add, I see only Tomcat 7 and Tomcat 8, but not Tomcat 9.
What I have done:
1) installed tomcat 9 to local server;
2) updated eclipse to Mars (latest as of 2015-11-25);
3) installed eclipse "JST Server Adapters" and "JST Server Adapters Extensions"
Note:
My purpose of using tomcat 9 is it seems to be the only version that explicitly support java 8 and later, and my web app is using java 8. (http://tomcat.apache.org/whichversion.html)
I also have tomcat 7 exist in project but I also want to keep it in the machine, not to delete it.
Please see screenshot.
Please let me know about any config that I missed!
There are two things to note here:
Tomcat 9 is not released yet. Not a final version that is. If you check the official website, you will see that the only available version is an M1 version. Hence there is no support from Eclipse WTP for this early version. It will come soon, but not yet.
Tomcat 9 is not the only version that explicitly supports Java 8. If you check this page, you will see that "Supports Java version: 8 and later", which in this context means, that it officially support only Java 8 and above. It does not mean however this is the only one supporting Java 8. Theoretically you should be able to use any Tomcat version, in practice a Tomcat 8 will work perfectly well, since it support Java 7 and above. The majority of people with a Java8 + Tomcat combination are using Tomcat 8. Tomcat 8 also has Eclipse WTP support.
I was able to get the adapters for Apache 9 by installing Eclipse Java EE Developer Tools 3.9.4
Use a later version of eclipse e.g. Eclipse Neon.
It should work.
I tried all the above methods but still was unable to find solution for the problem then I did the following and that helped me to add Apache tomcat to my Eclipse IDE:
After following Help>Eclipse Marketplace and installing Eclipse Java EE Developer Tools 3.10 still tomcat was not available so I went to Help>Eclipse Marketplace>Installed>Eclipse Java EE Developer Tools 3.10>Change I put tick on the following and then I got the Apache Tomcat finally in my Eclipse IDE:
JST Server Adapters
JST Server Adapters Extensions
JSF Tools-Tag Library Metadata(Apache Trindad)
Git Integration for Eclipse
Use later EE version of Eclipse! Contains Tomcat adapters 8.5 and 9.0
I had same problem, but not now.
On my side, eclipse marketplace was stucked on previous WST server adapters.
I've used old update feature Windows > Install New Software
In main update site, I found Web, XML, Java EE and OSGi Enterprise Development part, where WST Adapters where ready to update ...
Eclipse MarketPlace often embed too much features & plugins.
On my own point view, easier to keep a light eclipse ;-)
Tested on eclipse 2020-09
I am migrating an application that used Jetty 7.4.5.v20110725 to Jetty 9.3.0.M2, using Maven. I already had upgraded the javax.servlet-api to 3.1.0.
But I am using the FakeHttpServer version 0.3.0 for tests, and at this time there is no newer version. It uses the org.eclipse.jetty.server.nio.SelectChannelConnector class that used to exist up to Jetty 8.x, but does not exists anymore in Jetty 9.
Currently my projects breaks at runtime with a NoClassDefFoundError due to the removed class in Jetty that FakeHttpServer tries to use, holding me back from upgrading Jetty. What can I do to fix that?
Note, this was also cross-posted in the Portuguese StackOverflow version: https://pt.stackoverflow.com/q/64548/132
Upgrade the code that uses Jetty on FakeHttpServer for Jetty 9.
That is your only choice if you want to use Jetty 9 with FakeHttpServer.
Looking at the project page for FakeHttpServer, it seems that there have been no updates (commits) to the project tree since Dec 2012.
You'll either have to convince the project leads to update it, or do it yourself.
Note that Jetty contains several ways of testing webapps. Look at the unit tests in the jetty source code and I'm sure you will find the equivalent of FakeHttpServer.
ServletTester comes to mind as one example. Or just create a Server using the LocalConnector is another way.
We currently use Glassfish 3 and I really want to use Java 8. I tried upgrading to Glassfish 4, but I experienced two bugs in the Glassfish 4 code so I had to revert back to Glassfish 3. Will Glassfish 3 work with Java 8 or will I have to upgrade my application container?
No, it won't be possible (at the moment, maybe a workaround will occur later).
I tried Glassfish 3.1.1 and Glassfish 3.1.2.2 with the final Java 8 JDK which was released today. It doesn't even start the server, some OSGI exceptions are thrown.
As the comment to your question showed, it doesn't even work with earlier builds of Glassfish 4.0.
Update 2015:
It looks like there is a way to make it work with Glassfish 3.1.2.2.
Open the file /glassfish/domains/domain1/config/osgi.properties of your Glassfish installation and add the following line at the end of the file: jre-1.8=${jre-1.7}
This should make the server start with JDK 8. It still doesn't work for Glassfish 3.1 or 3.1.1.
See also:
JDK-8020071 Unable to start Glassfish 3.1.1. with JDK 8
GLASSFISH-19363 GF fails to start on jdk8
Stopped by an error after upgrading my Java 7 to Java 8.
Glassfish 3.1.2.2 just won't start.
Found a solution:
edit osgi.properties file in the glassfish/config folder and add this line at the end:
jre-1.8=${jre-1.7}
After fixing the osgi.properties as mentioned in the other answer, the HTTPS listeners will not work anymore until a patch is applied as mentioned here.
I am having trouble using my local JBoss Web 2.1.9.GA instance within my local Eclipse installation as a Server Runtime Environment.
Our client uses JBoss Web 2.1.9.GA instead of a standard Tomcat 6 installation, and so I am required to test and debug with a local JBoss Web 2.1.9.GA instance. Now, I am aware that JBoss Web is simply a rebranded and only slightly modified version of Tomcat 6, but when I try to use the "Apache > Apache Tomcat v6.0" server runtime as my choice, and then select the server base folder on my machine, I receive the following error at the top of the dialog:
The Apache Tomcat installation at this directory is version 2.1.9.GA. A Tomcat 6.0 installation is expected.
I am unsure how to get this working as it is intended to work at this point; there doesn't seem to be any options that will accept a JBoss Web 2.1.9.GA server folder. There also seems to be practically zero information online concerning the use of JBoss Web within Eclipse.
For context, I am using the SpringSource Tool Suite v2.9.2.RELEASE pre-packaged Eclipse install on a MacBook Pro running OS 10.7.4. It shouldn't matter however, java is java, and Eclipse is Eclipse, yes?
Has anyone had experience and luck with this?
Tom Harris
(I posted this question on Feb 22, but there was still no answer on March 5, so I am appending this note and rewording the question a bit.)
am developing a simple web app using jsps and servlets for tomcat 5.5.
Currently using the Eclipse Helios and Dynamic Web Application Project.
For some reason it is a nightmare. We spent 4 hours today trying to deploy a servlet to tomcat. We kept getting errors like
"java.lang.UnsupportedClassVersionError: Bad version number in .class file"
we played around with everything trying to set the build compatibility to what tomcat had but couldn't make the stupid thing work. (Yes it is possible we're incompetent. any suggestions on what we can try looking at are apprecieated)
My friend recalls from long time ago that he used this plugin
eclipsetotale_tomcatPlugin
in order to create a "tomcat project". My question is, does sysdeo tomcat plugin add any features that aren't already available in helios?
thanks
Not sure about sysdeo, but your error seems similar to bug 116713:
If your default JRE is set to 1.4.2 and you have a Web project targetting
Tomcat 5.5 (dynamic Web module version 2.4 and Java 5.0), when you tried to run
a main program, you'll get the error (you mention).
What is your default JRE set for your project?
This scenario happens when the JVM running the code is older than the one the compiler generated code for.
Have you considered simply running Tomcat under Java 6? If that is not an option, please edit your question to include this and any other restrictions on this project.
We used to get that error often when we had Java version issues. Eclipse environment and Windows environment (java_home and path variables typically) are easy to overlook.
Also, you can use javap -v Foo in same directory as Foo.class to find out its version.
Just use the Eclipse IDE for Java EE Developers, 206 MB edition of Eclipse. It has Tomcat and other webserver support built-in by default. Works like a charm!
Sysdeo is an old, as far as I know obsolete, plugin.