Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: NullPointer Exception while loading bean file through ClassPathXmlApplicationContext

  1. #11

    Default

    Tried with JDK6....but no use.......

  2. #12
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Can you post your project (zip it and attach it leave out the jar files but list them)...

    I don't really get the error in the init block...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #13

    Exclamation

    HelloSpring.zip[QUOTE=Marten Deinum;426825]Can you post your project (zip it and attach it leave out the jar files but list them)...



    The Jar file used were as follows:

    aspectjrt-1.5.4.jar
    aspectj-tools-1.0.6.jar
    aspectjweaver-1.5.4.jar
    commons-logging-1.1.1.jar\commons-logging-1.1.1.jar
    antlr-runtime-3.0.1.jar\antlr-runtime-3.0.1.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.aop-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.asm-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.aspects-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.beans-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.context.sup port-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.context-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.core-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.expression-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.instrument. tomcat-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.instrument-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.jdbc-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.jms-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.orm-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.oxm-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.test-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.transaction-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.web.portlet-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.web.servlet-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.web.struts-3.1.2.RELEASE.jar
    spring-framework-3.1.2.RELEASE\dist\org.springframework.web-3.1.2.RELEASE.jar

  4. #14
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Runs without problems on my machine... (Although I changed it to a maven project).

    One thing I notice is you have conflicting aspectj versions (1.5.4 and 1.0.6 ?!).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #15

    Default

    Quote Originally Posted by Marten Deinum View Post
    Runs without problems on my machine... (Although I changed it to a maven project).

    One thing I notice is you have conflicting aspectj versions (1.5.4 and 1.0.6 ?!).
    I think aspectj jar files were not necessary to run this program.

    I remover these jar files and recompiled the program, but still the same problem........

    thanks for taking interest to solve this problem..

  6. #16
    Join Date
    Dec 2010
    Location
    Singapore
    Posts
    287

    Default

    Did you try with a FileSystemXmlApplicationContext?

    Code:
    ApplicationContext ctx = new FileSystemXmlApplicationContext("exact path");
    Amila Domingo

  7. #17

    Default

    The problem is solved!

    By using JDK6 and Spring frame work 3.1.0 release!

    But it didn't worked when using 3.1.2 release! I don't know why? Can any one explain ?

    Will there be a relation between the version we use?

  8. #18
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    I tested it on 3.1.2 without any problems...

    I still find it strange that it gives a NullPointer in a static initializer block, which if I look correctly doesn't make any sense. Which JDK version en type (32 or 64 bit) did you try?
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  9. #19

    Default

    Quote Originally Posted by Marten Deinum View Post
    I tested it on 3.1.2 without any problems...

    I still find it strange that it gives a NullPointer in a static initializer block, which if I look correctly doesn't make any sense. Which JDK version en type (32 or 64 bit) did you try?

    64bit version.

  10. #20
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Ah... I tested on a 32bit system... So there could be a difference in JDK implementation...

    Could you create a small testcase (preferable maven or gradle driven) and a description (especially the 64bit part) and register a JIRA issue so that the spring team can look into it.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •