I am using eclipse as my ide. I had imported some spring projects from my instructor. In those when I expand the project in server deployment list, it shows spring web library. I created some project of my own from scratch but in those i cant see any expanding icon on my project in the server deployment list. And my project isnt running as well. What can I do so that my project also shows up the library? I checked the deployment library and it shows all the libs.
Also in my marker I see this error. How to correct this.
Description Resource Path Location Type
Archive for required library: 'E:/path/to/local/repo/org/springframework/spring-expression/3.1.1.RELEASE/spring-expression-3.1.1.RELEASE.jar' in project 'SpringTemp' cannot be read or is not a valid ZIP file SpringTemp Build path Build Path Problem
Got it .
Changed the version of spring framework version in POM file from 3.1.1 to 3.2.3 and it worked.
Related
I've recently started learning Spring REST. As part of my learning process, I developed a simple Hello World application using Maven. The directory structure of maven offered by Eclipse doesn't contain the "
java" folder in src/main. So, I added it explicitly. It turns out the application gives me a 404 error as you can see in the below image. I'm sure this has something to do with the class path. As I'm new to maven I don't understand the concept of the classpath.
But in the second image, I created the project using "co.ntier" (maven archetype for Spring MVC). The directory structure of this archetype has got the java folder which is why when I run the application I'm able to get the output.
How to add or configure maven so that every time I create a new maven project, the directory structure will have the java folder? Please help me.
I recommend to always create a Maven project from an archetype.
You can e.g. use the quickstart archetype for a simple project.
The presence of a "java" folder has nothing to do with whether an application can successfully serve something at a particular url. They are not directly related. This also has nothing to do with the classpath.
However, the red mark on the project indicates an error, and as the DEFAULT location for compilable source in a Maven project is "src/main/java", it seems clear that the lack of the "java" folder results in the project not being deployed, which IS why you get a 404.
In short, if you have red marks in the project, it's not going to deploy.
I just downloaded the Spring IDE and Tool suite from Eclipse Market place.I am creating a sample Spring project using Spring core containers. I am following a tutorial video for that. I want to set build path by adding external downloaded Spring jars for that I have gone to build path of a specific project and I don't know where my downloaded external spring jars. I have searched in my local drive in java folder in programming files and also where my eclipse is saved. But I cannot find where my external spring jar files saved.
Kindly tell me the path where I can find external downloaded jars from eclipse Marketplace
Spring Suite tool is Rapid Application Development plugin, which helps to decrease spring configuration time and help you focus on core logic of your application.
Even though, As Martin Lippert Explain below, you might have to use Maven (Build Automation tool, And project dependency manager) for creating spring project.
people often use Maven for their dependency management (or Ivy or something else) and would like to use a specific version of the Spring framework (instead of the libs that are inside STS and used by STS itself). But you can define a user-defined Library that contains all the necessary Spring framework JARs and maybe others and just add that user-defined library to each project. Would make it a bit easier as adding several JARs all over again.
Maven uses a filesystem tree as a repository to store jar files with there metadata(dependency, version, etc.) which is located (by default) under your home or My Document Path within .m2 directory (folder).
BackGround:
I am using Eclipse Lunar along with the Google App Engine plugin to try and build a website. Everything was going well until I wanted to save some data so I followed the tutorial on using Objectify. I downloaded the Objectify jar and placed it in "/war/WEB-INF/lib/" and then added it to the classpath. I then made a ObyHelper.java class as instructed in the tutorial and made a couple of my own test classes (which for now you can assume to contain no errors). I can successfully deploy too.
The question
When attempting to load the jsp page that uses Objectify (or any servlet/jsp url for that matter) I get the following error:
Uncaught exception from servlet
java.lang.NoClassDefFoundError: Could not initialize class com.googlecode.objectify.ObjectifyService
What did I do wrong and how should I have added the Objectify jar to the class path?
In order to get the jars to work in the GAE plugin for eclipse project structure you need to
1) place the jar on the WEB-INF/lib folder (in order for them to be deployed to the cloud)
2) add those jars to the classpath manually in order for eclipse to recognize them on you local dev environment.
Have you read the Setup documentation?
https://github.com/objectify/objectify/wiki/Setup
You need the guava jar as well. But really you should use Maven (or Ivy, or Gradle); manually copying jars is very old skool.
I imported a sample project into my workspace and when i tried executing it, I found build path errors as
.../springframework/..3.1.0 release.jar(missing)
.
.
.
.
.//all such framework .jar files missing
I tried importing spring framework libraries all those missing libraries shown in the build path, but couldn't solve the errors.(i have imported spring release of 4.0.5 version)
If i need to only import 3.1.0 release, please do share the link from where i have to download the required libraries.
Probably the project you imported has absolute references to the Spring jars. Right click on the project and go to Properties/Java Build path/Libraries. Remove the absolute references and add the new ones.
Concerning the Spring 3.1 jars, you can download them from here: http://mvnrepository.com/artifact/org.springframework/spring-core/3.1.1.RELEASE
Add spring jar dependency into pom.xml then click on mvn clean & install.
I'm developing an AppEngine project in Java.
I'm working on a MacBook and on other two PCs.
I'm using a hosted SVN as my RC.
I included some libraries from the GAE plugin in my project:
gwt-dev.jar, gwt-user.jar', validation-api-1.0.0.GA.jar.
I did that in the Java Build Path in the project properties.
Every time I switch a computer, I get an error:
Project '' is missing required library: ''. Off course, the path is changing between computers.
How can I resolve this issue?
Should I remove this settings from being stored on the SVN repository? If I shpould, how can I do that?
You should not persist any user-specific path information. Set your projects up by hand and then check out the user-agnostic stuff.
We have the same problem with IntelliJ. The answer is to check in only user-agnostic information, or get an IDE that's smart enough to use relative paths.
If you add 3rd party libraries to the project, make sure they are copied into your /lib directory and not in a path that's unique to you.
Create a project for the libraries.
Put the libraries in the project.
Export the jar files.
Set this newly created project as a dependency in the main project.