java spring simple application

java spring simple application

hai I have design a simple application in this I always found class not found exception. I am sendig code as follows please resolve this and send me.my directory structure is as follows

Project:Student/src/com.mazeed/StudentComponet.java/TestClient.java/springConfig.xml for this I have added lib files also

StudentComponent.java:

package com.mazeed;

public class StudentComponent {
    private String sname;
    public String getSname() {
        return sname;
    }
    public void setSname(String sname) {
        this.sname = sname;
    }
    public String getFname() {
        return fname;
    }
    public void setFname(String fname) {
        this.fname = fname;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    private String fname;
    private String city;
    public StudentComponent() {


    }

}

TestClient.java

package com.mazeed;
import org.springframework.beans.factory.*;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.*;

public class TestClient {
public static void main(String[] args)
{
    Resource res=new ClassPathResource("springConfig.xml");
    BeanFactory container=new XmlBeanFactory(res);
    System.out.println("container created");
    Object o=container.getBean("studbean");
    StudentComponent sc=(StudentComponent)o;
    System.out.println(sc.getCity());
    System.out.println(sc.getFname());
    System.out.println(sc.getSname());

}
}

Beans configuration:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean id="studbean" class="StudentComponent" 
    abstract="false" lazy-init="default" autowire="default"
    dependency-check="default">
    <property name="sname">
    <value>mazeed</value></property>
     <property name="fname">
     <value>Raheem</value>
     </property>
  <property name="city">
  <value>Hyderabad</value>
  </property>
View Answers

June 2, 2011 at 12:33 PM

Please visit the following link:

Spring Tutorials


June 2, 2011 at 12:33 PM

Please visit the following link:

Spring Tutorials









Related Tutorials/Questions & Answers:
java spring simple application
java spring simple application  hai I have design a simple application in this I always found class not found exception. I am sendig code as follows.../beans/spring-beans-2.5.xsd"> <bean id="studbean" class="StudentComponent
Simple IO Application - Java Beginners
Simple IO Application  Hi, please help me Write a simple Java application that prompts the user for their first name and then their last name. The application should then respond with 'Hello first & last name, what
Advertisements
Simple Java Desktop Upload application
Simple Java Desktop Upload application  I try do simple example for upload applicationtake file from c:\ put to d:\ :) PLEASE HELP
Hibernate Simple Program Using Java Application with Eclipse
Hibernate Simple Program Using Java Application with Eclipse  How to write Hibernate Simple Program Using Java Application with Eclipse? I wish to learn Hibernate using very popular Eclipse IDE. Share me the best tutorial link
Java Spring Desktop application
Java Spring Desktop application  Hi i am developing a desktop java spring application..It has many Jframes forms and classes...How to close one Jframe from another..Please tell... First jframe package desktopapplication2
Simple Spring Boot Example
Simple Spring Boot Example - First example of Spring Boot for counting no of beans Spring Boot Simple Example, writing and running the first example code.... In this tutorial we are going to create a very simple and first Spring Boot
Simple Spring Boot Example
Simple Spring Boot Example - First example of Spring Boot for counting no of beans Spring Boot Simple Example, writing and running the first example code.... In this tutorial we are going to create a very simple and first Spring Boot
Simple application using hibernate
Simple application using hibernate  Hi, How to write a simple application using hibernate in Eclipse IDE? I would like to to learn: Process... of the tutorial you will like to learn for creating the simple application using
JSF Simple Login Application - Java Server Faces Questions
JSF Simple Login Application  Hi there, I have implemented all the things which you mentioned in " JSF Simple Login Application " . but as i insert USER_ID and PASSWORD then it is showing an exception which
Java Spring Desktop application with multiple classes and jframe
Java Spring Desktop application with multiple classes and jframe  Hi i am developing a desktop java spring application..It has many Jframes forms and classes...How to close one Jframe from another..Please tell... First jframe
simple bank application - JSP-Servlet
simple bank application  hi i got ur codings...But if we register a new user it is not updating in the database...so plz snd me the database also.... Thank you
Spring application in RSA 7.0.0.3
Spring application in RSA 7.0.0.3  how to build a sample spring application using RSA 7.0.0.3
Simple Bank Application in JSP
Simple Bank Application in JSP       In this section, we have developed a simple bank application in jsp . In this application user can Update the User Profile, Cash
Spring login form application
Spring login form application  Hi Please give me the Spring login form application so that i can understand its flow ?   Hi please find the link of the tutorial Spring Applications
Simple Calculator Application In Java Script
Simple Calculator Application In Java Script  ... the basics of JavaScript and create your first JavaScript program. What is simple Calculator The objective of this project is  learn how to write a simple
Simple Web Application using Servlet
Simple Web Application using Servlet       In this section, we have developed a simple web application in Servlet . In this application user can add, update and delete all
How to use css in simple HTML application
How to use css in simple HTML application   Please give simple example for understanding purpose
For CRUD application - Spring
For CRUD application  Hi, Can i have Crud(create ,edit,update,delete the data in database ) code & search the eployee using "id or name" using Spring ,Hibernate and Mysql Thanks Raghavendra
Spring Boot Console Application
Spring Boot Tutorial- Spring Boot Console Application Welcome to the first example of Spring Boot, today we will teach you to create your first application...-based application that prints messages on console using the Spring Boot. We
Spring Boot Console Application
Spring Boot Tutorial- Spring Boot Console Application Welcome to the first example of Spring Boot, today we will teach you to create your first application...-based application that prints messages on console using the Spring Boot. We
Web application - Spring
Web application  I need one simple complete web application example using springs with database connection,i saw ur demo but it is not succfient.can u send to [email protected] am a beginner
How to add a bean in spring application?
How to add a bean in spring application?  Hi, How to add a bean in spring application? Thanks
Building a Simple EJB Application Tutorial
Building a Simple EJB Application - A Tutorial   ... a simple session EJB and a client web application using eclipse IDE along with Lomboz plug in and XDoclet. This application,    while simple
Developing Simple Struts Tiles Application
Developing Simple Struts Tiles Application  ... will show you how to develop simple Struts Tiles Application. You will learn... Steps To Create Tiles Application Tiles is very useful framework
How a simple "Hello World" can be displayed using Spring 3.2 MVC?
How a simple "Hello World" can be displayed using Spring 3.2 MVC?  Hi, How a simple "Hello World" can be displayed using Spring 3.2 MVC? Thanks... application of framework based on Java Platform. For creating a small program of Hello
ClassNotFound Exception:DispatcherServlet in spring application?
ClassNotFound Exception:DispatcherServlet in spring application?  **I... environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.001\bin... org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'dispatcher
Login Application
Login Application       This tutorial provides some simple steps for creating a website login application that can be used later in any big Struts Hibernate and Spring based
pls provide steps to write ejb3.0 simple application in eclipse - EJB
pls provide steps to write ejb3.0 simple application in eclipse   hi, pls provide steps to create simple ejb3.0 application in eclipse .And also how to create entity bean ,session bean in ejb3.0
what is diffrence between the spring and ejb which is better for small application - Spring
appplication.what is diffrence between the struts with spring application and struts without... is an open source application for the Java platform whereas EJB is a server-side...what is diffrence between the spring and ejb which is better for small
Java Application
Java Application  Hi, What is the applications of Java in development of software? What type of applications can be developed using Java programming Language? Can anyone tell me the url for downloading sample projects in Java
Spring, Hibernate login and registration application
Spring, Hibernate login and registration application Spring, Hibernate login... fully function login and registration application in Spring and Hibernate... started:ADS_TO_REPLACE_2 How to make Simple form in Spring web
JSF Simple Login Application
:view> <html> <head><title>JSF Simple Login Example<...-app PUBLIC "-//Sun Microsystems, Inc. //DTD Web Application 2.3//EN" "http
Simple JSF Hello Application
Simple JSF Hello Application    ... application. In this example we will explain all you need, to develop this application like how to use JSF tags in JSP pages, how to configure the application
Simple input application in Echo3
Simple input application in Echo3       In this sample server-side application we have created an application which contains the window from where the user can  input
Spring Hello World Application
Spring Hello World Application       Hello World Example using Spring, The tutorial given below describes you the way to make a spring web application that displays
Spring Hello World Application
Spring Hello World Application       Hello World Example using Spring, The tutorial given below describes you the way to make a spring web application that displays Hello World
Simple Java Projects
Simple Java Projects  Hi, I am beginner in Java and trying to find Simple Java Projects to learn the different concepts on Java. Can anyone tell me where to get it? Thanks
Simple FTP upload in Java
Simple FTP upload in Java  How to write a program for Simple FTP upload in Java? Any code example of Simple FTP upload in Java will be very helpful for me. Thanks
simple calculator - Java Beginners
simple calculator  how can i create a simple calculator using java codes?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
Simple java applet
Simple java applet  Create a Java applet to display your address on the screen. Use different colors for background and text   Please visit the following link: Applet Examples
simple java search engine
simple java search engine  i have already downloaded the project simple java search engine.but i am not able to run it.can anyone help me.i have.... ABSTRACT Title : Simple Search Engine System Specification: The system on which
Simple ATM Java Code...
Simple ATM Java Code...  You are required to write a Graphical User Interface that simulates an ATM by building on the program you wrote for the midterm exam. Specifically, you will be reading customer information into an array
simple code - Java Beginners
simple code  to input a number and check wether it is prime or not and print its position in prime nuber series.  Hi friend, Code to help in solving the problem : import java.io.*; class PrimeNumber { public
A simple question - Java Beginners
A simple question   Design a program to calculate either the square of a number or the square root of a number and display the results. output should be like:- Enter a float value: 6.2 Do you want the (s)quare or square (r
How to make Simple form in Spring web?
. In this tutorial we are creating a simple form in Spring MVC which displays two.... ADS_TO_REPLACE_4 How to develop simple form in Spring MVC? Following components needs to be developed and integrated in order to run a simple form in Spring
how to implement Single Sign On in enterprise application using spring framework
how to implement Single Sign On in enterprise application using spring framework  how i can implement the single sign on in my spring based web app..i am new to spring frame work..any help will be appreciated as its urgent
Steps to create simple EJb 2.1 (Session Bean) and deploy on websphere application server 6.0,
Steps to create simple EJb 2.1 (Session Bean) and deploy on websphere application server 6.0,  Hi friends, I am trying to create simple hello world session bean having Java client. but i am unable to run it on Websphere
How to make Struts Hibernate and Spring Based Login/Registration Application?
How to make Struts Hibernate and Spring Based Login/Registration Application... to make application. Check the tutorial Developing Struts Hibernate and Spring Based... in Hibernate. Is there any code for to make Struts Hibernate and Spring Based Login
Java application - Java Beginners
Java application  Write a Java GUI application called Index.java that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text
Java Client Application
Java Client Application  Java Client Application

Ads