Spring is not able to detect WebException in java file -
i'm trying data server given id every thing working well, want handle exceptions in code invalid id such id there no data @ server server throws me error want handle exception tried use web exception spring not detecting it
error is:
webexception cannot resolved type
my pom file:
<properties> <spring.version>4.1.0.release</spring.version> </properties> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- spring dependencies --> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-core</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-web</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>commons-codec</groupid> <artifactid>commons-codec</artifactid> <version>1.9</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-jdbc</artifactid> <version>4.1.0.release</version> </dependency> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.1.9</version> </dependency> <!-- spring aop dependency --> <dependency> <groupid>cglib</groupid> <artifactid>cglib</artifactid> <version>2.2</version> </dependency> <!-- hibernate framework --> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate</artifactid> <version>3.2.3.ga</version> </dependency> <!--<dependency> <groupid>hibernate</groupid> <artifactid>hibernate3</artifactid> <version>3.2.3.ga</version> </dependency> --> <!-- hibernate library dependecy start --> <dependency> <groupid>dom4j</groupid> <artifactid>dom4j</artifactid> <version>1.6.1</version> </dependency> <dependency> <groupid>commons-logging</groupid> <artifactid>commons-logging</artifactid> <version>1.1.1</version> </dependency> <dependency> <groupid>commons-collections</groupid> <artifactid>commons-collections</artifactid> <version>3.2.1</version> </dependency> <dependency> <groupid>antlr</groupid> <artifactid>antlr</artifactid> <version>2.7.7</version> </dependency> <!-- hibernate library dependecy end --> <dependency> <groupid>javax.transaction</groupid> <artifactid>jta</artifactid> <version>1.1</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-orm</artifactid> <version>${spring.version}</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> <version>3.6.0.final</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>1.6.5</version> </dependency> <dependency> <groupid>javassist</groupid> <artifactid>javassist</artifactid> <version>3.12.1.ga</version> </dependency> <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> <version>2.3.1</version> </dependency> <dependency> <groupid>org.apache.poi</groupid> <artifactid>poi</artifactid> <version>3.11</version> </dependency> <dependency> <groupid>org.apache.poi</groupid> <artifactid>poi-ooxml</artifactid> <version>3.9</version> </dependency> <dependency> <groupid>commons-io</groupid> <artifactid>commons-io</artifactid> <version>2.4</version> </dependency> <dependency> <groupid>org.gvnix</groupid> <artifactid>org.gvnix.web.exception.handler.roo.addon.annotations</artifactid> <version>2.0.0.m1</version> </dependency> </dependencies>
my java file:
try{ result = resttemplate.exchange("https://example.com/{id}", httpmethod.get, new httpentity<string>(createheaders()), string.class); } catch(webexception e) { system.out.println(e); }
Comments
Post a Comment