Java – sever: exception start filter CORS
•
Java
I deployed restful web services on Tomcat 'Web services work normally on clients / servers in the same domain Scenario', but I need to make cross domain web services available for this purpose, so I have used CORS filter
I've included the jar of the filter in myprojects / lib and Tomcat / lib, and it's in the web The XML file also includes the following contents:
<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>
However, when I try to start the web service, I receive the following error message about the CORS filter:
SEVERE: Exception starting filter CORS java.lang.NoClassDefFoundError: com/thetransactioncompany/util/PropertyParseException at com.thetransactioncompany.cors.CORSFilter.init(CORSFilter.java:100)
Please guide me to find out what's wrong with this situation
Solution
You also need to add java-properties-utils-1.7 Add the 1. Jar file to the classpath because the CORS filter has dependencies
http://search.maven.org/#browse%7C -411787350
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码
