I have RESTful web service deployed on tomcat' the web service is working fine in the client/server on same domain scenario' but I am required to make the Web Service available from cross domain' for this purpose I have used CORS filter.
I have included filter's jars in both myProjects/lib and tomcat/lib' and also have included following in my web.xml file of web service project'
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
</filter>
<init-param>
<param-name>cors.supportedHeaders</param-name>
<param-value>Accept, Origin, X-Requested-With, Content-Type, Last-Modified</param-value>
</init-param>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
But when I try to start the web service I get following error regarding CORS filter:
SEVERE: Exception starting filter CORS
java.lang.NoClassDefFoundError: com/thetransactioncompany/util/PropertyParseException
at com.thetransactioncompany.cors.CORSFilter.init(CORSFilter.java:100)
kindly guide me to figure out what is wrong with this situation'
You need to add java-properties-utils-1.7.1.jar file to the classpath too as the cors filter has a dependancy on it.
http://search.maven.org/#browse%7C-411787350
In my case, adding these 2 jar files in the tomcat lib folder solved the issue:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With