Spring

import java.io.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JLabel;

import javax.swing.JTextArea;

import javax.swing.JTextField;

import org.springframework.beans.factory.*;

import org.springframework.beans.factory.xml.*;

import org.springframework.core.io.*;

publicclass HelloFrameDemoextends Frame{

JTextFieldjtfName;

JTextAreajtArea;

JLabel jlbName;

JButtonjbnExit;

publicstaticvoid main(String args[]){

HelloFrameDemo helloApp =new HelloFrameDemo();

helloApp.setSize(670,230);

helloApp.setVisible(true);

}

HelloFrameDemo(){

setLayout(new FlowLayout());

setBackground(Color.lightGray);

jlbName=new JLabel("Enter Name: ");

jtfName=new JTextField(25);

jtArea=new JTextArea(10,50);

jbnExit=new JButton("Exit");

jbnExit.setBackground(Color.red);

jbnExit.addActionListener(new ActionClass());

jtfName.addActionListener(new ActionClass());

add(jlbName);

add(jtfName);

add(jtArea);

add(jbnExit);

}

publicclass ActionClassimplements ActionListener{

publicvoid actionPerformed(ActionEvent e){

if(e.getSource() == jbnExit ){

System.exit(0);

}elseif(e.getSource() == jtfName ){

jtArea.append("Loading message..\n\n");

BeanFactory factory = [b][b]new XmlBeanFactory(new FileInputStream("hello.xml"));[/b][/b]

Hello helloBean = (Hello)factory.getBean("hello");

String s = helloBean.greeting(jtfName.getText());

jtArea.append(s);

}

}

}

}

I am getting the following error

The constructor XmlBeanFactory(FileInputStream) is undefined

I have added all the external jars that have come with the spring distribution. Is there an other way i can point to the xml file....

[3695 byte] By [hemanthjavaa] at [2007-10-3 9:19:00]
# 1
actualy the compiler is right there is no constructor like XmlBeanFactory(FileInputStream) check the API documentationyou should have specified the version of spring you're using
alban.maillerea at 2007-7-15 4:32:08 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...