eclipse jetty:run differs to cli mvn jetty:run - eclipse

I have managed to track a problem where within eclipse I see no error, but anywhere outside eclipse the error exists.
The error I get when run outside eclipse is LazyInitializationException from hibernate - caused by a ${entity.service.id} reference in the jsp.
Outside eclipse I have tried jetty standalone, mvn jetty:run from the command line, and tomcat. I've cleaned the projects, disabled workspace dependency etc. I'm using eclipse galileo, m2eclipse 0.9.8.200905041414, jdk 1.6_17, maven 2.1.1 (not embedded), jetty 6.1.22 (standalone and plugin).
How is that possible??

oh my goodness. it works outside eclipse under jdk1.5.0_15 in windows, but not linux! I need it to work under linux. help!!

Related

Configuring lombok for gradle project in eclipse Luna/Mars

I have followed how to configure lombok in eclipse luna but it is not working for me for a given gradle project, against the latest version of lombok, having tried both eclipse Luna and Mars.
I have installed lombok to my eclipse through java -jar lombok.jar, providing it the path to my eclipse installation in the UI dialog that it opens up.
I have also added the jar to the project, as seen below.
I added the following argument to the java command in my desktop launch script (this is Ubuntu)
-vmargs -javaagent:lombok.jar
(relative and absolute paths worked the same).
The project is a gradle project, and it builds perfectly fine outside of eclipse.
What might be missing, or, how would I further troubleshoot it?

Errorneous Message "No setter found for property" in eclipse kepler with Spring 3.2

Got an error in my Spring context file about an not existing setter for property, even it's existing. It's a Spring MVC project and it's compiling and working on my Tomcat.
IMHO it's a Eclipse problem (Eclipse Kepler) + or there seems to be a problem with Maven, which I am using with Eclipse.
It seems the issue with eclipse. You can check following things,
As it is a maven project the output folder is correct Java Build Path->Source->Default output folder is set to <ProjectName>/target/classes
If your able to build and run it from maven outside the eclipse then try to using same maven installation inside eclipse.
You can try run following maven command to refresh the build paths,
mvn clean install eclipse:clean eclipse:eclipse
There's something that i always do with Maven and Eclipse that works more often than not. If you can perform your mvn clean install outside of eclipse, then make sure the same maven is used inside inside Eclipse and then:
1/ project-->Properties-->Maven--> uncheck Resolve dependencies from Workspace projects --> Apply --> OK
2/ project-->Properties-->Maven--> check Resolve dependencies from Workspace projects --> Apply --> OK

Eclipse 3.7, m2eclipse & losing artifacts after changing pom.xml

I have a bit of a problem with Eclipse and Maven for a few months. After changing the pom.xml, Eclipse is losing all artifacts and getting this exception in my Maven console:
Missing artifact commons-logging:commons-logging:jar:1.1:compile
Eclipse doesn't find any artifacts. My workaround is to close Eclipse, run mvn clean install on the command line and start Eclipse. This workaround works without any problems, but is not really the right way. How can I fix this issue?
I'm running Eclipse 3.7 and the newest m2eclipse(-extra), Windows 7 64bit with JDK 1.6.0.24.
I assume it builds ok when Maven is explicitly run - yes?
Have you tried right-clicking on the project and selecting
Maven..Update Project Configuration
and
Maven..Update Dependencies?
If not, that's likely to solve your problem.
Are you also running
mvn eclipse:eclipse
I had a similar issue and I ran that, the refreshed the project in eclipse and everything worked fine.

maven adds dependency but eclipse does not see it

I've created a new project in maven like this:
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
After that I use: mvn eclipse:eclipse
The problem is that when I add the project to my IDE, eclipse indicates errors. When I run it I get classNotFound for JUnit. In project properties I see that junit is added to build path
In project properties I see: M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar
But I cant use for example: import junit.framework.Test;
Why is that? To be honest, I have some major problems with dependency in maven and eclipse. Maven adds them correctly but eclipse doesn't see it correctly. It's not only the junit. What should I check/set?
Should I install some plugin to eclipse for maven support ?
EDIT
I thought again about everything. Of course the problem was small. M2_REPO was not recognize by Eclipse. I've added this variable and set it in od maven directory. It worked like a charm.
You can use the m2eclipse plugin for eclipse
http://m2eclipse.sonatype.org/installing-m2eclipse.html
I don't know if having the plugin would solve your problem, I used to do the command line before I started using m2elcipse, I never had the issue that you described
what version of eclipse are you using?

Eclipse (STS) + Maven

I basically have 2 questions:
Is there a way to invoke maven console from eclipse? (where I could write eclipse:eclipse, and it started building eclipse project)
Where does STS unpack it's maven? I'd like to add that path to env variables, so that I could use it from my windows console.
Is there a way to invoke maven console from eclipse? (where I could write eclipse:eclipse, and it started building eclipse project)
You could open a shell inside eclipse , cd into the right directory and run the maven console from there. But, when using M2Eclipse (see next point), you're not supposed to run eclipse:eclipse.
Where does STS unpack it's maven? I'd like to add that path to env variables, so that I could use it from my windows console.
STS bundles M2Eclipse which comes with an embedded version of Maven (so it doesn't "unpack" Maven). But you can Configure M2Eclipse to use an external version. Go to window > Preference > Maven > Installations and Add... your external install:
Try the m2eclipse plugin from sonatype and you can eliminate use of 'mvn eclipse:eclipse' altogether. After installing m2eclipse and restarting eclipse, select File->Import->Maven->Existing Maven project. Browse to your maven project and select it. The m2eclipse plugin reads the pom and creates an eclipse project (this is the step that 'mvn eclipse:eclipse' gives). There are other useful features of the m2eclipse plugin including pom editor.
m2eclipse project is moving out of sonatype into the eclipse foundation project page and will be released on the Indigo train.
See this page for more info on m2eclipse: http://m2eclipse.sonatype.org/