Javatpoint Logo

exception in thread main java.lang.error unresolved compilation problems eclipse

By: pnsmgl*** On: Wed Jul 03 13:10:18 EDT 2013     Question Reputation20 Answer Reputation4 Quiz Belt Series Points0  24Blank User
DrawingApp.java
-------------
package org.sp;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DrawingApp {
public static void main(String[] args) {

ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
Triangle triangle=(Triangle)context.getBean("triangle");
triangle.draw();
}
}
----------------------------------------
spring.xml
----------
<?xml version="1.0" encoding="UTF-8"?>


<beans>
<bean id="triangle" class="org.suresh.Triangle" /beans>
</bean>
-----------------------------------------------------

Triangle.java
------------

package org.sp;

public class Triangle {
public void draw(){
System.out.println("Triangle draw");
}

}
-------------------------------------------------------------
Error:
---------
xception in thread "main" java.lang.Error: Unresolved compilation problems:
The method XmlBeanFactory(FileSystemResource) is undefined for the type DrawingApp
Syntax error, insert ")" to complete VariableInitializer

at org.suresh.DrawingApp.main(DrawingApp.java:9)
===========================================================================


even though i am using eclipse there is no compilation error but when i run the program it gives an error plz tell me.
Up1Down

 
This error happens when you use Eclipse as IDE and try to run code that doesn't even compile. Check your Problems view in Eclipse, and fix the compilation errors before executing the application.Image Created0Down

By: [email protected] On: Thu Jul 04 02:54:38 EDT 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :4Yes6No
 
me too facing the below Error while executing the below program, please help

Exception in thread "main" java.lang.Error: Unresolved compilation problem:

at SeleniumPackage.Method.main(Method.java:12)



package SeleniumPackage;

public class Method {


public int multiply (int a,int b, int c){

int result=a*b*c;
return result;
}

public static void main (String [] args){


Method obj = new Method ();


int x=obj.multiply(10, 20, 30);

System.out.println(x);

}



}











}
Image Created0Down

By: [email protected] On: Sat Dec 03 21:04:29 IST 2016 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No