Configuration Issue In Spring MVC setup - java

I am setting a project for Spring MVC but it seems to hold some issue.
while configuring I am Tomcat-7 and JRE 1.8 but due to this project is not setting up.
Earlier when I was learning Spring Core JRE 1.8 was not an issue it was automatically getting configured. But now while building MVC project it is generating below problem, it say's
"Faceted Project problem(Java Version Mismatch)"
and is this happening when i am not using this Apache Tomcatv7 is being loaded along with JRE1.7
[1: this image I have manually changed the JRE1.8]
https://drive.google.com/open?id=1JNEoP8_Yb79-2dGGFm3EaZKI5uHjj5RB
[2: But still on selecting Apache Tomcat JRE1.7 is being loaded]
https://drive.google.com/open?id=1SVlL1h7rF9kspYNnUe70O5Y3NYalBtQ2
I therefore want to use JRE1.8 for configuring the project, but it seems Apache Tomcat version is Generating problem.
So do I need to upgrade the version of Tomcat??

For your first statement :
In offcial page of Tomcat it says that Tomcat 7.x is compatible
with JDK-6 and higher version of JDK. So JDK 8 should not give an
issue with it.
I think the main reason could be, different versions of Java in compiler and in project facets. The Java facet version needs to always match the java compiler compliance level.
If you want to use Java compiler level as 1.8, then you should upgrade tomcat runtime envionment to java 8 and also change the project facets to 1.8.
Java 7 at the runtime and java 8 at compile time, this combination will not work. this would be worked for vice versa.
You can change Java runtime as follows :
1. select Apache> Tomcat 7 Server
2. Configure Runtime Environments
3. On this screen there is a pulldown labeled JREs.
4. You should find your JRE listed. If not use the Installed JRE button.
5. Select the desired JRE. Click the FINISH button.
Hope this solves your problem. Do upvote if this has helped a tiny bit :)

Related

How to Use Java 8 settings to build project in eclipse 4.18(2020-12)

*Due to some project requirements I "have" to use eclipse 4.18 (2020-12) which uses Java 11 by default and is mandatory to start.
But my entire project is/was written in Java 1.7 earlier. Now , in my mac i have both java 1.8 and 11 installed also my eclipse settings are such shown below.
I have made sure removed all java 11 references in my eclipse and made the project and workspace configure to take the 1.8 jdk and run at 1.7 compiler level.*
but when i run ,project -->clean-->build, i run into the JaxB missing in java 11 ( in java 11 JAXB was removed and my project uses jaxB extensively) This is known.
So i am wondering what am i missing that my projects are still building my project with java 11 and not java 1.7 (using jdk 1.8 configured).
Please help.. stuck on this since some days.
machome
Eclipse Compiler setting-1
Eclipse Setting Execution Envs
Eclipse installed JRE's
Eclipse Project specific setting
Java 11 JaxB error
If Eclipse itself is being run with Java 11, and you have a plug-in installed that has not been properly update to work under Java 11, as it appears, you will need an updated version of that plug-in. Update to the latest "oracle design studio", and if you still see this problem, contact Oracle support.
The latest Eclipse may require Java 11 to run, but it's simple to set up Eclipse projects that use older Java versions. Don't mess with the Java version it uses to start up, as long as that is a proper Java 11 version.
As one commenter mentions, you'll have to have a particular Java distribution configured in "Installed JREs->Execution Environments", and then you'll have to have the project configured to use that Java version symbol, like "JavaSE-1.7".

How do I support an application built using Java 1.8 in Java 9?

We have a standalone application built using Java 1.8 and when I test running that application using Java 9, I get a NoClassDefError exception on the javax.xml.soap.SoapException class. I have read enough to know that Java 9 now has the module concept... and that if I add the "--add-modules java.se.ee" option on my 'java' call in the startup script for the application, it then runs correctly.
My question is... how do I still support this application running against a 1.8 JRE? I can't just put the --add-modules option in the startup script since that causes an error when attempting to run against the 1.8 JRE. I really don't want to have to put logic in the startup script to try to determine which version of JRE the user is running and optionally put the new --add-modules option in there.
Any suggestions? Thanks in advance!
You should include java9 specific information 'module-info.java' into your application, so it will not require the command line option. See e.g. here: How to add a Java 9 module via manifest.mf?
The web services module (java.xml.ws, which includes SAAJ) has been deprecated in Java SE 9 with a view to removing it from Java SE and the JDK in the future. The first step on that road to removing it is to not resolve it by default. It is "as if" the module does not exist and this is why you get a CNFE when you run it on JDK 9.
Yes, you can workaround around it temporarily with --add-modules=java.xml.ws (more precise than --add-modules=java.se.ee) and you should be able to get your script to pick this up using the JDK_JAVA_OPTIONS env variable (see http://jdk.java.net/9/release-notes#JDK-8170832) which is new in JDK 9 and so will be ignored in JDK 8.
The alternatives (and the JDK 9 Migration Guide will have more on this) is to move to the standalone version of JAX-WS and SAAJ. These APIs have standalone versions that update at a different pace to Java SE and the JDK. You should find the latest (2.3.0) in Maven for example. The standard versions can be deployed on the class path, and in the future as modules in the event that you migrate your application to modules in the future.
Please take a look at this article. This gives the ways to solve the compatibility concern that you have raised.
https://dzone.com/articles/the-legacy-developers-guide-to-java-9
Please include module-info.java file in your application. Java 9 will consider the same and will be ignored by Java 8.

Is It Possible To Use The IBM WebSphere JAX-WS Runtime To Generate Web Services In Eclipse 4.x?

I'm attempting to generate a JAX-WS server top down (from a WSDL) for the IBM WebSphere v7 runtime using Eclipse Kepler. The problem I'm running into is that I simply cannot select the web service runtime to be IBM WebSphere JAX-WS, there is no option for it. I've installed the WebSphere Application Server Developer Tools plugin for Kepler and configured the runtime in Eclipse to be the runtime installed on my system. I can also compile applications against the WAS 7 runtimes and deploy them to a WAS 7 server, so it would appear the runtimes are available.
The biggest thing that's frustrating me is that the option is available in Eclipse Indigo (3.x). To make sure there wasn't something awry with my work space or install in any way, I downloaded fresh copies of both versions of Eclipse, started with fresh work spaces, and installed the WAS 7 plugin on both versions from the marketplace. Eclipse 3.x gives me the option, but 4.x does not.
Now, I know these plugins are different versions. The version provided by the marketplace for Eclipse 4.x is 8.5.5011.v20131031_0202 while the version for 3.x is 8.5.1002.v20130402_2058, which based on the version number appears to be about 7 months older. This leads me to my question, is it possible to use the IBM WebSphere JAX-WS runtime to generate web services in Eclipse 4.x anymore? I've tried searching the web all I can but have found no mention of this ability being removed from the plugin. I've even found other SO posts that make it seem like this once was available for Eclipse 4.x, but maybe no longer is with the latest version of the plugin (this linked question is over a year old). Does anyone know the answer to this. Is it no longer possible to do this, or is it actually possible by some other means that that you could share please?
Apparently this is fixed now (see https://www.ibm.com/developerworks/community/forums/html/topic?id=29712397-fdfd-41be-8668-ada56447711a). The version of the plugin didn't change, but it sounds like there was an update to the plugin that fixed a bug.

GAE getting started in Java, Eclipse Indigo - can't compile as 1.6

I feel like I keep going in circles with this one. I followed the Getting Started guide for Google App Engine (https://developers.google.com/appengine/docs/java/gettingstarted/) in Eclipse and everything went relatively well until I uploaded it to the App Engine.
I was getting 500 errors so I checked the logs and found this: "guestbook/SignGuestbookServlet : Unsupported major.minor version 51.0]"
I then search for this problem (on stackoverflow, of course) and found this solution: Google App Engine and Java Version?
So I set the compliance level to 1.6 and then at the bottom of the dialog I get the warning that "When selecting 1.6 compliance, make sure to have a compatible JRE installed and activated (currently 1.7)".
I happy click OK, and it prompts for a rebuild. After the rebuild I then get this new error: "Java compiler level does not match the version of the installed Java project facet."
Not having knowingly used any facets in the project I do a search for some help (again on stackoverflow) and find this: "Faceted Project Prblem (Java Version Mismatch)" error message
Unfortunately it is not even close to being helpful because I am not used Maven, and when I bring up the properties of the project there is no Project Properties -> Project Facets panel for me to change a version on.
So it seems that I am stuck with something that either cannot be compiled in Eclipse or cannot be deployed to App Engine. I know that I am probably missing something obvious here but I can't quite put my finger on it.
UPDATE: I have uninstalled all JREs and JDKs, and reinstalled only jdk1.6.0_32. The problem continues exactly the same.
I had the same problem. I was able to resolve by using the Navigator view and editing the .settings/org.eclipse.wst.common.project.facet.core.xml, changing to:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.6"/>
</faceted-project>
After this change, the error went away and I could successfully run the GWT project in DevMode using jre1.7 but java 1.6 compliance level.
It really seems there should be a way to edit this java facet via project configuration, but I couldn't find it in Juno.
The answer, at least in my case, seems to be that if your Eclipse default compiler level is set to 1.7 when you create the Web Application then you can't switch it down to 1.6 successfully.
Example 1: Using JRE 1.6
In eclipse set Preferences->Java->Installed JREs to jdk 1.6.0_32
Set Preferences->Java->Compiler to compliance level 1.6
Use google plugin to create "New Web Application"
Run it locally - success
Deploy to app engine, run remotely - success
Example 2: Using JRE 1.7
In eclipse set Preferences->Java->Installed JREs to jdk 1.7.0_04
Set Preferences->Java->Compiler to compliance level 1.7
Use google plugin to create "New Web Application"
Run it locally - success
Upload to app engine - failure (Unsupported major.minor version 51.0)
In eclipse set Preferences->Java->Compiler to compliance level 1.6 - failure (won't compile locally (Java compiler level does not match the version of the installed Java project facet).
Solution:
Before using the google plugin to create the Web Application, switch the JRE and compiler level to 1.6 (as seen in example 1).
If your project already exists, then hopefully you haven't got too far with it and can create it again.
After fighting this issue for a few hours, deleting my nocache.js in the war folder was the final piece of the puzzle.
Contrary to the answer above, I was able to succesfully downgrade to compliance level 1.6 after creating the application in 1.7

does sysdeo tomcat plugin for eclipse add value to helios?

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.

Categories