For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 6 replies, 4 voices, and was last updated 21 years ago by
Riyad Kalla.
-
AuthorPosts
-
asaf_lahavMember– System Setup ——————————-
Operating System and version: windows XP
Eclipse version: 3.1
Eclipse build id:
Fresh Eclipse install (y/n): y
Other installed external plugins: NONE
Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
MyEclipse version: 4.0m1
Eclipse JDK version: 1.5.0_08
Application Server JDK version: Tomcat 5.0
Are there any exceptions in the Eclipse log file? No– Message Body ——————————-
I am a trial MyEclipse user.
When I attempted to use myEclipse with Spring framework (by adding spring capabilities to my project) and started coding a very trivial sample, i encountered a very persistent exception.My Code:
sprngConf.xml ----------------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="myDataSource" class="src.MySpringTest" destroy-method="close"> <property name="myProp" value="myPropValue" /> </bean> </beans> MySpringTest.java ---------------------- package src; public class MySpringTest { private String _s = null; public void setMyProp(String s){ this._s = s; } public void close(){ System.out.println(new String("close called")); } public void Execute(){ System.out.println(new String("hello world")); System.out.println(_s); } } myMain.java --------------- import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import src.MySpringTest; public class myMain { /** * @param args */ public static void main(String[] args) { try{ //XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("myFile.xml")); Resource res = new FileSystemResource("src\\sprngConf.xml"); XmlBeanFactory bf = new XmlBeanFactory(res); MySpringTest mbo = (MySpringTest) bf.getBean("myDataSource"); mbo.Execute(); } catch(Exception ex){ ex.printStackTrace(); } } }The Exception i’m constantly bumping into is as follows:
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) (Caused by org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.springframework.beans.factory.support.AbstractBeanFactory.<init>(AbstractBeanFactory.java:99)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:113)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.<init>(DefaultListableBeanFactory.java:87)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:67)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:56)
at myMain.main(myMain.java:15)
Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
… 10 more
Caused by: java.lang.NullPointerException
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:374)
… 11 more————————————————————————
Please, I need your help with this.Thanks,
AsafJuly 28, 2005 at 9:13 am #233830
Dave TrussellParticipantDo you have commons-logging.jar listed under Libraries in the Java Build Path? I’m going through Pro Spring and found I had pretty much the same problem until I threw commons-logging.jar at it.
July 28, 2005 at 4:37 pm #233865
asaf_lahavMemberActually I used the add capabilities feature of my eclipse.
I have:
Spring 1.2 All Libraries
Spring 1.2 DAO Libraries
Spring 1.2 Core LibrariesAll added to my projects build path.
July 30, 2005 at 3:09 am #233973
asaf_lahavMemberHi All,
I eventually discovered the reason this is not working for me.
I am very disappointed to say that the reason this very simple project I built didn’t work. And it is myEclipse.As soon as I built a new pure java project (NOT USING myEclipse add capabilities) spring worked like a charm.
Anyhow, to sum it up, My Eclipse cost me about a week.
Sorry for the harsh opinion,
AsafJuly 30, 2005 at 11:00 am #233976
Riyad KallaMemberAsaf,
We are sorry you ran into this issue, there does seem to be a problem with the commons-logging build that Spring was using in the version we included, we are going to upgrade that before release.August 12, 2005 at 6:33 pm #234675
David Orriss JrParticipant@asaf_lahav wrote:
Actually I used the add capabilities feature of my eclipse.
I have:
Spring 1.2 All Libraries
Spring 1.2 DAO Libraries
Spring 1.2 Core LibrariesAll added to my projects build path.
Just an FYI.. If you include “Spring 1.2 All Libraries” you don’t need to include the DAO and Core entries. They’re included in the “All” configuration.
August 14, 2005 at 9:40 am #234720
Riyad KallaMemberDaveO,
We are changing this internally to respect the pre-reqs of these libraries better. -
AuthorPosts
