Details
Description
Hi community,
I modified the Java Classes: GridJettyRestHandler and GridJettyRestProtocol It's including support for JSF WebPages, auto load JNDI for JDBC/Ignite, Tunning for Thread of Jetty Embedded & support for context root page (if exists /ignite context is set for rest).
Please remove old libraries of Jetty inside of ignite-rest-http folder. The list of depencies are the next:
Access to ignite DataBase (Mandatory when exist WAR files inside of the deploy folder)
commons-dbcp2-2.7.0.jar
commons-lang-2.6.jar
commons-pool2-2.8.0.jar el-ri-1.0.jar
Support for JAX-WS via Apache Metro
webservices-api.jar
webservices-extra-api.jar
webservices-extra.jar
webservices-rt.jar
webservices-tools.jar
ignite-rest-http-2.7.6.jar must be Modified with the classes GridJettyRestHandler and GridJettyRestProtocol)
ignite-web-2.7.6.jar
jackson-annotations-2.9.6.jar
jackson-core-2.9.6.jar
jackson-databind-2.9.6.jar
javax.el-api-3.0.1-b06.jar
javax.servlet-api-4.0.1.jar
jboss-jsf-api_2.2_spec-2.2.14.jar
jetty-continuation-9.4.22.v20191022.jar
jetty-http-9.4.22.v20191022.jar
jetty-io-9.4.22.v20191022.jar
jetty-jndi-9.4.22.v20191022.jar
jetty-plus-9.4.22.v20191022.jar
jetty-security-9.4.22.v20191022.jar
jetty-server-9.4.22.v20191022.jar
jetty-servlet-9.4.22.v20191022.jar
jetty-util-9.4.22.v20191022.jar
jetty-webapp-9.4.22.v20191022.jar
jetty-xml-9.4.22.v20191022.jar
jsf-api-2.2.19.jar jsf-impl-2.2.19.jar
jsp-api-2.2.1-b03.jar log4j-1.2.17.jar
slf4j-api-1.7.7.jar slf4j-log4j12-1.7.7.jar
tomcat-servlet-api-9.0.10.jar
Inside of the web.xml in the webpage is need add the next lines for access to Ignite Datasource:
<resource-ref>
<description>Ignite DataSource Reference</description>
<res-ref-name>jdbc/ignite</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
Call to Datasource from java: (DataSource) initContext.lookup("java:comp/env/jdbc/ignite");
For run JAXWS
Add the next lines in the web.xml:
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
Then is needed to create the file sun-jaxws.xml (inside of WEB-INF folder)
put the next lines (are a example):
<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">
<endpoint name="NewWebService" implementation="cl.mc3d.ws.NewWebService" url-pattern="/NewWebService" />
</endpoints>