frascati issueshttps://gitlab.ow2.org/frascati/frascati/-/issues2018-02-06T10:32:19Zhttps://gitlab.ow2.org/frascati/frascati/-/issues/104Improvement for implementation velocity in FraSCAti. Add the possibility to u...2018-02-06T10:32:19ZJeremie GuillemotteImprovement for implementation velocity in FraSCAti. Add the possibility to use templates in a tree organisation.Improvement for implementation velocity in FraSCAti (ProxyImplementationVelocity.java).
Here is the original code : http://websvn.ow2.org/filedetails.php?repname=frascati&path=%2Ftrunk%2Ffrascati%2Fmodules%2Ffrascati-implementation-velo...Improvement for implementation velocity in FraSCAti (ProxyImplementationVelocity.java).
Here is the original code : http://websvn.ow2.org/filedetails.php?repname=frascati&path=%2Ftrunk%2Ffrascati%2Fmodules%2Ffrascati-implementation-velocity%2Fsrc%2Fmain%2Fjava%2Forg%2Fow2%2Ffrascati%2Fimplementation%2Fvelocity%2FServletImplementationVelocity.java
The proposition is to add this portion of code to offer the possibility to load Velocity templates not only in a base folder but also in a folder tree.
Here is the code addition to solve this problem (can be found also on GitHub : https://github.com/easysoa/EasySOA/blob/master/easysoa-proxy/easysoa-proxy-core/easysoa-proxy-core-httpdiscoveryproxy/src/main/java/org/ow2/frascati/implementation/velocity/ProxyImplementationVelocity.java)
....
protected final String invoke(String method, VelocityContext context, String[] args, Object... parameters) {
// VelocityContext context = new VelocityContext(this.velocityContext);
context.put(params, parameters);
// FIXME: should not be called but @Lifecycle does not work as expected.
registerScaProperties();
StringWriter sw = new StringWriter();
// **** EasySOA Hack begin
int pathArgIndex = Integer.parseInt((String) context.get("pathArgIndex")); // pathArgIndex has been set as an SCA xsd:int property
int storeIndex = Integer.parseInt((String) context.get("storeIndex")); // storeIndex has been set as an SCA xsd:int property
Template template = null;
if (parameters.length > pathArgIndex) {
Object templatePathFound = parameters[pathArgIndex];
Object storeNameFound = parameters[storeIndex];
if (templatePathFound instanceof String) {
template = this.velocityEngine.getTemplate((String)storeNameFound + "/" + (String) templatePathFound);
}
}
// *** EasySOA Hack end
if (template == null) {
String name = this.velocityEngine.templateExists(method + ".vm") ? method + ".vm" : this.defaultResource;
template = this.velocityEngine.getTemplate(name);
}
if (!this.velocityEngine.invokeVelocimacro(method, method, args, context, sw)) {
template.merge(context, sw);
.....
Currently, the method parameter contains the name of the velocity template to use. It is not possible to call templates in an other folder or in a folder tree organisation.
The hack uses 2 properties to set the array position of 2 parameters "pathArgIndex" and "storeIndex". The "pathArgIndex" parameter contains the folder where to find the "storeIndex" template.
An other solution is to have a special method name (eg : folder1_folder2_template) to pass the informations.
A third solution is to use a special method name, allowing to pass special params, to be able get templates in a tree folder organisation.
1.5https://gitlab.ow2.org/frascati/frascati/-/issues/105HTTP Binding : Jetty connection not closed when FraSCAti stop2018-02-06T10:32:19ZJeremie GuillemotteHTTP Binding : Jetty connection not closed when FraSCAti stopThe problem occurs when a HTTP binding is used in a composite and this composite is started on a tomcat embedded FraSCAti (packaged in a war).
When the stop command is sent to the tomcat server, the FraSCAti composite are trigered to st...The problem occurs when a HTTP binding is used in a composite and this composite is started on a tomcat embedded FraSCAti (packaged in a war).
When the stop command is sent to the tomcat server, the FraSCAti composite are trigered to stop. There is a problem with the components using a HTTP binding, the jetty resources are not unregistred/destroyed correctly.
In some cases, the java process ends but in others the java process remains alive and the resart of the application is not possible because the error "port already in use is throwed".
After some researchs, we have seen that the JettyServletManager.unregisterServlet(...) method is never called for an HTTP binding. In the HttpBinding class, there are an init and a destroy methods associated with @init and @destroy annotations. These annotations do not seem to work. The destroy method is never called and the init method is called "manually" in the FrascatiBindingHttpProcessor class (See method doInstanciate, line 154).1.5