Today I encounter this error when working on a spring project in eclipse when trying to start the tomcat server on the spring mvc project:
"class path resource [properties/server-${spring.profiles.active}.properties] cannot be opened because it does not exist"
The issues turned out to be that the spring project has two properties files: namely server-dev.properties and server-production.properties. The project define a property "spring.profiles.active" which need to be supplied to the tomcat server when launching the spring mvc project so that the proper properties file can be loaded. The problem occurred because i was did not specify the argument when launching the project. To resolve this, double click the tomcat server instance in the "Servers" window in Eclipse and click the "Overview" tab. In the "Overview" tab, click "Open launch configuration" link. In the "Edit Configuration" dialog opened, click the "Arguments" tab, and append the following to the "VM arguments" textbox:
-Dspring.profiles.active=dev
Showing posts with label Spring Tool Suit. Show all posts
Showing posts with label Spring Tool Suit. Show all posts
Saturday, October 17, 2015
Saturday, December 20, 2014
Maven: missing artifact org.eclipse.equinox.app.jar
Sometimes if one sees the errors such as "missing artifact org.eclipse.equinox.app.jar..." in Eclipse or Maven, it is probably they did not set the repository right in their pom file. Below is the repositories which can be added to the pom file that might resolve the error:
<repositories>
<repository>
<id>clojars</id>
<url>http://clojars.org/repo</url>
</repository>
<repository>
<id>mvnCentral</id>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
<repositories>
<repository>
<id>clojars</id>
<url>http://clojars.org/repo</url>
</repository>
<repository>
<id>mvnCentral</id>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
Sunday, December 14, 2014
Eclipse: Java was started but returned exit code=13
Recently I have an update from Oracle on my Windows 7's Java jre. After i suddenly was no longer able to launch my Eclipse or Spring Tool Suit application. It always throw the following error when i try to launch the Eclipse application.
Java was started but returned exit code=13
C:\ProgramData\Oracle\Java\javapath\javaw.exe
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xms768m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.IEVersion=10001
-jar
D:\STS\sts-3.6.3.RELEASE\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
-os win32
-ws win32
-arch x86_64
-showsplash
-launcher D:\STS\sts-3.6.3.RELEASE\STS.exe
-name STS
--launcher.library
...
I was in a bit of shock initially, but realized that somehow, the update may have messed up my default java jre path, as the error indicating it is using javaw.exe from "C:\ProgramData\Oracle\Java\javapath;" and i don't remember that i set include java's bin path as this directory. Therefore, I run the following commands:
> java -version
> javac -version
True enough they refers to very different version, next I want to find out which version of java.exe i am currently using and from which directory, and i run the following command:
The print out indicates the current java.exe being used is from "C:\ProgramData\Oracle\Java\javapath;", I then remove the "C:\ProgramData\Oracle\Java\javapath;" from the $PATH system environment variable.
Further mess up was noticed when i rerun the command "for %i in (java.exe) do @echo. %~PATH:i" and some other app's java.exe shows up. This is finally fixed when I move my JAVA_HOME/bin directory to be the first entry in the PATH system environment variable. This finally fix my problem.
Java was started but returned exit code=13
C:\ProgramData\Oracle\Java\javapath\javaw.exe
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xms768m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.IEVersion=10001
-jar
D:\STS\sts-3.6.3.RELEASE\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
-os win32
-ws win32
-arch x86_64
-showsplash
-launcher D:\STS\sts-3.6.3.RELEASE\STS.exe
-name STS
--launcher.library
...
I was in a bit of shock initially, but realized that somehow, the update may have messed up my default java jre path, as the error indicating it is using javaw.exe from "C:\ProgramData\Oracle\Java\javapath;" and i don't remember that i set include java's bin path as this directory. Therefore, I run the following commands:
> java -version
> javac -version
True enough they refers to very different version, next I want to find out which version of java.exe i am currently using and from which directory, and i run the following command:
> for %i in (java.exe) do @echo. %~$PATH:i
The print out indicates the current java.exe being used is from "C:\ProgramData\Oracle\Java\javapath;", I then remove the "C:\ProgramData\Oracle\Java\javapath;" from the $PATH system environment variable.
Further mess up was noticed when i rerun the command "for %i in (java.exe) do @echo. %~PATH:i" and some other app's java.exe shows up. This is finally fixed when I move my JAVA_HOME/bin directory to be the first entry in the PATH system environment variable. This finally fix my problem.
Saturday, December 13, 2014
Eclipse: The method ? of type ? must override a superclass method
Recent I import and git project into Spring Tool Suit and Eclipse, it comes up with the following annoying errors such as :
"The method prepare(Map, TopologyContext, OutputCollector) of type AnalyticBolt must override a superclass method"
My imported project is littered with all these errors. After some search online, it turns out that these are caused by the compliance of eclipse to Java 1.5, which does not recognize @Overrride attribute.
I was able to correct this by:
1. Right-click the project and select "Properties"
2. "Java Compiler" in the "Properties" page and uncheck "Use compliance from execution environment 'J2SE-1.5' on the 'Java Build Path'
3. Set the 'Compiler compliance level:" to 1.7
4. Click "OK".
"The method prepare(Map, TopologyContext, OutputCollector) of type AnalyticBolt must override a superclass method"
My imported project is littered with all these errors. After some search online, it turns out that these are caused by the compliance of eclipse to Java 1.5, which does not recognize @Overrride attribute.
I was able to correct this by:
1. Right-click the project and select "Properties"
2. "Java Compiler" in the "Properties" page and uncheck "Use compliance from execution environment 'J2SE-1.5' on the 'Java Build Path'
3. Set the 'Compiler compliance level:" to 1.7
4. Click "OK".
Subscribe to:
Posts (Atom)