This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange Spring problem

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm getting a strange compilation error while trying my first Spring applications, where I'm passing a reference to a FileInputStream to the constructor of an XmlBeanFactory. It's saying that constructor is not found!

Can anybody tell me what can be the problem ?

Thanks in advance ...
[ October 03, 2007: Message edited by: Bear Bibeault ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me peak into my crystal ball and see if I can read your code from here. Man, this is tough. It's pretty cloudy. I wish there was an easier way. My crystal ball just isn't working right.

Ok, how about you post your relevant code/configuration here so I can let my crystal ball take a break.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lolllll

Here it goes:



Thanks in advance ...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the stack trace as well as your test.xml file as well? We need all the information.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, it could be because XmlBeanFactory doesn't accept a String as a constructor argument.

http://www.springframework.org/docs/api/org/springframework/beans/factory/xml/XmlBeanFactory.html#XmlBeanFactory(org.springframework.core.io.Resource)
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need a crystal ball to find that out
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not passing a String, I'm passing a reference to a FileInputStream ...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm passing a reference to a FileInputStream

The problem is that there's no such constructor for the XmlBeanFactory. Use a FileSystemResource instead :
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I used FileSystemResource and it's giving me the following exception:



 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Commons logging from apache jakarta is missing on your classpath.
There is quite a bunch of libraries, spring depends on.
Download the with-dependencies thing (for example: http://sourceforge.net/project/showfiles.php?group_id=73357&package_id=173644&release_id=538515)
You dont need any of those jars for a little project. Newer books tend to start with a short introductions about when which jar is needed. Currently I can't find such information online. Of course for starting you may put all jars from the with-dependencies download in your classpath. Or start with spring.jar and add those which are missing.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have included the apache commons API in my classpath, but yet another problem raised now , here it is:



and here's my test.xml file



Can anybody tell me what's going on ? I'm so confused about this

Thanks in advance ...
 
Ashish Ojha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Vassili,
Try working with the DTD in place of schema to the spring context file.

use this--

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
........
.......
</beans>

I think that will work.
bye
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked

Thanks alot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic