Announcement Announcement Module
No announcement yet.
STS build paths and java class libraries Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS build paths and java class libraries

    I recently downloaded the latest version of sts and went through the requisite updates.

    When trying to build app using mostly POJOs which
    Import javax.persistence classes I notice that the javax libraries
    Cannot be resolved. Isn't't the javax library a standard lib
    That should alrready exist in the main STS build path? Do I have to download this
    Lib seperately? Which standard java class libs are already included in sts?
    Are there any specific updates I can do to ensure that I have as many
    Java libraries as possible? Would greatly appreciate any advice. Thanks!

  • #2
    I did a quick google search for you. I don't think this is part of a standard JDK. It is part of Java EE SDK.

    (FYI: here is a link to the search:

    The following seems like useful information for you:

    The j2ee.jar is one that you will need. Note however that, from what I googled, I think this jar only contains 'stubs' and interfaces. You will also need something like hibernate or something similar to provide an actual implementation (assuming you want to run your code rather than just compile it :-)



    • #3

      Thanks a lot for your help. I'll look for the right jars and let you know. From what I'm also 'googling' it seems like the right Hibernate version is the one from JBoss (

      However another problem is STS doesnt let me install any hibernate updates due to a dependency conflict so I'm not sure which is the right version of Hibernate to use and how best to install the correct libraries on STS.

      I really thought this application on Spring uses standard java classes but seems like finding the right libraries can be quite tricky on Spring framework. Would greatly appreciate some more advice. Many thanks again!


      • #4
        The reason why it is difficult is that you are trying to build a project and set it all up yourself.
        Most people are probably using tools like maven to help install dependencies.

        Rather than start from scratch it may be easier for you to use a framework like spring-roo to generate most of the app you want to build for you. Or at least use a sample app. (There are some template projects in STS that should be relatively easy to get started with).

        To get to the templates do
        "File >> New >> Project"

        Then search for 'template'. You will find "Spring Template Project".
        Select that and see which one of the templates looks most like what you are trying to build.

        If you are having trouble with using the templates... (as you can imagine, they do get out of date some times :-) please let us know. Making these templates work well for new users is something that STS team is actively working on at the moment.



        • #5
          I followed your advice and set up a project using the Spring MVC template. So first step was simply to test the generated application. I tried running the index.jsp and got the following error (which leads me to think there is something wrong with my STS configuration):

          java.lang.ClassNotFoundException: org.apache.catalina.filters.SetCharacterEncodingFi lter
          at org.aspectj.weaver.bcel.ExtensibleURLClassLoader.f indClass(
          at java.lang.ClassLoader.loadClass( 07)
          at java.lang.ClassLoader.loadClass( 48)
          at org.apache.catalina.core.DefaultInstanceManager.lo adClass(
          at org.apache.catalina.core.DefaultInstanceManager.lo adClassMaybePrivileged( :397)
          at wInstance(
          at org.apache.catalina.core.ApplicationFilterConfig.g etFilter(
          at org.apache.catalina.core.ApplicationFilterConfig.s etFilterDef(
          at org.apache.catalina.core.ApplicationFilterConfig.< init>(
          at org.apache.catalina.core.StandardContext.filterSta rt(
          at org.apache.catalina.core.StandardContext$
          at org.apache.catalina.core.StandardContext$
          at java.util.concurrent.FutureTask$Sync.innerRun(Futu
          at a:138)
          at java.util.concurrent.ThreadPoolExecutor$ Task(
          at java.util.concurrent.ThreadPoolExecutor$ (

          And the result was a 404 error on my IE web browser


          • #6
            Also I downloaded Maven and installed the dependency libraries in my original application, but can't seem to find the right information on how to use Maven to install the dependencies. I prefer your suggestion of using Spring templates but would still like to know how to properly use Maven in future. THANK YOU!


            • #7
              Sorry for not responding sooner. Perhaps the templates are not right for you. It depends what you are trying to do.
              But someone does need to look into the error you posted. I will follow up on it.

              EDIT: I raised this Jira issue about template project problem (

              Regards to using maven. I am not really an expert on those tools and don't use them myself. But I have to somewhat agree with you that finding info on maven eclipse support can be somewhat daunting. The docs for m2e are very poor.

              There are some tutorials out there on how to use maven in the commandline which is not that bad. If you are new to maven I suggest you should start with that and familiarize yourself with how maven works and its basic concepts.

              Here is just one suggestion:

              Often with maven and m2e (maven support for eclipse) you will need to find maven user forums / lists and ask questions there to get answers. The docs are not always up-to-date or complete.

              Last edited by Kris De Volder; Apr 23rd, 2012, 10:50 AM.


              • #8

                Your comments are very helpful and I greatly appreciate your help. What I'm trying to do is to build an enterprise application starting with a document management system (or CMS). The two options are either a simple structure using POJOs, xml and Tomcat OR a framework like Spring. I must say from limited experience that Spring doesn't appear to be easy to understand. Getting the templates to work seems to be quite tricky and there is little sample code for how to correctly build end-to-end applications like CMS. I will try my luck with the maven and other documentation which you kindly provided. For now, I simply want to be able to run the Maven / Hibernate sample and hoppefully I'll be able to figure out how to build customs apps in Spring. I definitely see the advantages of an open source framework like Spring, but the learning curve and available material has to make sense I think. Would welcome and other any other advice on the best way to learn and master Spring. Many thanks, J


                • #9
                  You probably already found this yourself. But just in case, this is the default 'getting started with spring' link.




                  • #10
                    BTW: I tried the mvc sample app and it worked for me.
                    You mentioned 'index.jsp' however. I don't have an index.jsp in my 'Spring MVC Sample'.
                    Makes me wonder... Was I using the same template as you?