Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Java

Hi,
I'm really terrible for all day with this error!
applicationContext.xml Checked !
I don't konw where is wrong!
Help me!





XML
java.lang.ExceptionInInitializerError
    at org.springframework.core.env.AbstractEnvironment.suppressGetenvAccess(AbstractEnvironment.java:398)
    at org.springframework.core.env.AbstractEnvironment.getSystemEnvironment(AbstractEnvironment.java:360)
    at org.springframework.core.env.StandardEnvironment.customizePropertySources(StandardEnvironment.java:79)
    at org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:124)
    at org.springframework.core.env.StandardEnvironment.<init>(StandardEnvironment.java:54)
    at org.springframework.context.support.AbstractApplicationContext.createEnvironment(AbstractApplicationContext.java:442)
    at org.springframework.context.support.AbstractApplicationContext.getEnvironment(AbstractApplicationContext.java:288)
    at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath(AbstractRefreshableConfigApplicationContext.java:122)
    at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations(AbstractRefreshableConfigApplicationContext.java:80)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:137)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at org.ctw.tabs.dao.test.PassengerDaoTest.Test1(PassengerDaoTest.java:16)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
    at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
    at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
    at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
    at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
    at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
    at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
    at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
    at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
    at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.NullPointerException
    at org.springframework.core.SpringProperties.<clinit>(SpringProperties.java:58)
    ... 34 more
Posted
Updated 7-Jul-15 6:28am
v2
Comments
Richard MacCutchan 7-Jul-15 12:35pm    
The key is the message at the end:
Caused by: java.lang.NullPointerException
at org.springframework.core.SpringProperties.<clinit>(SpringProperties.java:58)

This suggests that you code is missing some parameter on a library method call. Check your startup routines.
Member 11820084 8-Jul-15 5:45am    
Thanks! I will try ! I think maybe lost some of *.jar in the lib document.Now checking.....
I copy my code,please help me to find out the worng thing.

Richard MacCutchan 8-Jul-15 6:06am    
You seem to be posting random pieces of code in the hope that the problem will somewhow show itself. You need to run your code in the debugger to find exactly where the fault occurs and which parameter is missing.
Member 11820084 8-Jul-15 6:25am    
<context:component-scan
="" base-package="org.ctw.tabs">

<bean id="template"
="" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionfactory">
</property>


<bean id="sessionfactory"
="" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dbcp">
</property>
<property name="mappingLocations">
<list>
<value>org/ctw/tabs/entity/hbm/Passenger.hbm.xml
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>


<bean id="dbcp" class="org.apache.commons.dbcp.BasicDataSource">
<property name="username" value="root">
</property>
<property name="password" value="root">
</property>
<property name="url" value="jdbc:mysql:///t_abs">
</property>
<property name="driverClassName" value="com.mysql.jdbc.Driver">
</property>




Member 11820084 8-Jul-15 7:13am    
Can you tell me your email.I saw your summary.
I was a Software Support Engineer for many years using various legacy enterprise systems before learning UNIX and Windows programming - the latter largely in my own time. In my last few years of employment I spent more time in actual development.

Since retiring I have been learning some of the newer technologies (C#, .NET, WPF, LINQ, SQL ...) that I never used in my professional life, and am actually able to understand some of it.

One day I hope to become a real programmer.

I think i agree with your last sentence.Steve Jobs say:Stay hungry Stay foolish.
Your spirit inspires me.
I admire you a lot.I want to make friend! Thanks!

1 solution

There is something wrong but i can not find it!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900