I have a report with a dynamic xml file as datasource.
This file is generated previously to launch the report and is send like a report parameter.
So I declared a datasource with target in "property binding":
"/path_to_folder_with_generated_files/data/" + params["dynamic_xml_file"].value
At this point, go all right.
But i need that "/path_to_folder_with_generated_files/data/" will be
{BIRT_VIEWER_WORKING_FOLDER} + "/data/" + params["dynamic_xml_file"].value
where {BIRT_VIEWER_WORKING_FOLDER} will be the value of this context parameter declared in web.xml deploy descriptor.
How do i access to context parameters from birt javascript?
Environment: Birt 3.7.1 deployed in Glassfish 3.1, ubuntu linux, jdk 1.6
Solution in: http://www.eclipse.org/forums/index.php/mv/msg/277462/780873/#msg_780873
reportContext.getHttpServletRequest().getSession().getServletContext().getInitParameter("BIRT_VIEWER_WORKING_FOLDER") + "/data/" + params["dynamic_xml_file"].value
Thnaks, Jason.
Related
My application is using the following:
JDK version: Open JDK jdk-11.0.11+9 Payara : 5.2021.5 Spring version: 5.2.7.RELEASE jackson version: 2.9.4.
Payara 5.2021.5 uses Jackson version 2.10.2, whereas the application uses Jackson version: 2.9.4. It looks like the method signature for some Jackson methods used by SpringMVC has changed in Jackson 2.10.2.
On Server startup, the following Exception is thrown:
Details: Location: org/springframework/http/converter/json/Jackson2ObjectMapperBuilder$XmlObjectMapperInitializer.create
(Lcom/fasterxml/jackson/core/JsonFactory;)Lcom/fasterxml/jackson/databind/ObjectMapper; #15: areturn Reason: Type 'com/fasterxml/jackson/dataformat/xml/XmlMapper' (current frame, stack[0]) is not assignable to 'com/fasterxml/jackson/databind/ObjectMapper' (from method signature)
I tried disabling class loading hierarchy locally by setting element in the glassfish-web.xml as well as globally, by setting system property fish.payara.classloading.delegate to false in domain.xml
I also tried adding the following to web.xml as suggested in documentation, as well as the init parameter to DispatcherServlet, but does not seem to help-
<context-param>
<param-name>jersey.config.jsonFeature</param-name>
<param-value>JacksonFeature</param-value>
</context-param>
tried disabling class loading hierarchy locally by setting element in the glassfish-web.xml. It looks like Payara ignores this flag and continues to load the libraries in \payara-5.2021.5\payara5\glassfish\modules, instead of loading from the application. I even tried by replacing glassfish-web.xml with payara-web.xml
The issue resolved by setting system property fish.payara.classloading.delegate to false in domain.xml.
I am trying to annotate a sling filter in AEM 6.4 SP2 with the new
#SlingServletFilter(scope=SlingServletFilterScope.REQUEST)
annotation. After deploying I don't see the property "sling.filter.scope = REQUEST" in the Felix console and the servlet is also not triggered.
Any idea why?
The OSGI-standard annotations do work:
#Component(service = Filter.class,
property = {SLING_FILTER_SCOPE + "=" + FILTER_SCOPE_REQUEST)
Very probably the version of the bndtool is too low (at least 4.0.0).
Depending, what you use
bnd-maven-plugin 4.0.0, or
maven-bundle-plugin 3.0.0
See https://sling.apache.org/documentation/the-sling-engine/servlets.html (some details on bndtools are in the video)
I am trying to use Spring MVC 4's Rest templates to support google protocol buffers as message format. I have am following this post on Spring framework blog
spring-mvc-google-protocol-buffers
I checked out the sourceCode trying to implement it in my environment.
I have two issues- I cannot get it to compile when I turn Java.version to 1.6 and i cannot get it to work as a webapp (don't know what
will be the context-root of the converted war file)
-Details-
I have a requirement to make this code work as a web-app and deploy on java6 container (weblogic 10.3.6 -servlet 2.5 compliant)
So i changed the java 8 features from the codebase to make it Java 6 compatible.
The only problem is when I change the pom.xml's following section
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>demo.DemoApplication</start-class>
<java.version>1.8</java.version>
</properties>
to change the java.version to 1.6 value, then try to do mvn clean install , the DemoApplicationTests class fails to compile with this error.
-google-protocol-buffers-master\src\test\java\demo\DemoApplicationTests.java:28: cannot find symbol
[ERROR] symbol : constructor RestTemplate(java.util.List<org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter>) is not defined
[ERROR] location: class org.springframework.web.client.RestTemplate
The following link shows that Spring codebase normally doesn't have any Java 8 specific source code so not sure why this code only compiles in Java 8
https://spring.io/blog/2015/04/03/how-spring-achieves-compatibility-with-java-6-7-and-8
--------------------------------------------------------------------------------
The following link shows how to convert a spring boot application to a WAR app.
I did change the pom.xml packaging option to war.
The code gets build by mvn clean install without issues and the .war file gets generated.
But there's no web.xml - so i cannot tell what will be the context-root of the deployed web app.
I either way deployed the webapp on weblogic 10.3.6 ( which is java 6 compatible)
and it deployed fine.
But when I run the DemoApplicationTests (that I have changed to point straight to the URL
using this call (got the context-root from the weblogic console by clicking on the deployed web app)
ResponseEntity<CustomerProtos.Customer> customer = restTemplate.getForEntity(
"http://127.0.0.1:7001/demo-0.0.1-SNAPSHOT/customers/2", CustomerProtos.Customer.class);
I keep getting 404 not found error.
I have put up my changed code here.
https://github.com/robinbajaj123/spring-and-google-protocol-buffers
Your feedback will be appreciated.
You'd need to convert the Spring Boot app to also be a valid Servlet application. If you were using Servlet 3 or later and chose a .war-based deployment from start.spring.io you'd get a ServletIntializer which is a Java class that is the programmatic equivalent of web.xml. Since you're using 2.5, not 3.0, you need an explicit web.xml. You might check out this sample on how to get a Boot app hoisted up in a Servlet 2.5 environment, though using Servlet 2.5 is not recommended!. It's worth mentioning that Servlet 3.0 support was introduced in 2009..
Finally, this code uses Java 8 lambdas. You'll need to replace the lambdas with Java 6-equivalent code. One example I see is:
#Bean
CustomerRepository customerRepository() {
...
The last line in the #Bean definition returns a lambda: customers::get. Replace it with:
final Map<Integer, CustomerProtos.Customer> customers =
new ConcurrentHashMap<Integer, CustomerProtos.Customer>();
return new CustomerRepository() {
public CustomerProtos.Customer findById(int id) {
return customers.get( id) ;
}
};
Similarly, replace the forEach method in the List w/ an old-school for-in loop:
for (CustomerProtos.Customer c : Arrays.asList( ... )) {
customers.put(c.getId(), c);
}
I am trying to read my config files outside of my war file, So I declare a custom property / variable in Websphere 7.1. But some have websphere was not able to read the variable / token.
Error :
2015-04-30 18:19:57,459 ERROR [server.startup : 0] [] [] [com.abc.config.admin.ConfigTool] -
com.abc.config.AbcConfigException: Exception in loading configuration from file (${abc.config.dir}/configs): Parameter 'directory' is not a directory
web.xml:
<context-param>
<param-name>secondaryBasePathList</param-name>
<param-value>${abc.config.dir}/configs</param-value>
<description>
Directory/Path where the external files required for the
configuration framework
</description>
</context-param>
Here are the following ways I tried:
1. Set the property / token at server JVM Custom properties (as per Websphere document :https:// www-01.ibm.com/support/knowledgecenter/SSAW57_7.0.0/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/xrun_jvm.html?cp=SSAW57_7.0.0%2F3-16-5-448)
Set the property / token as websphere variable (as per Websphere document : https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/ucws_rvars_inst.html )
Set the property / token at server web container Custom properties (as per Websphere document :https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.zseries.doc/ae/rweb_custom_props.html )
All the above are not working for me..
Thanks
Dhana
WebSphere Application Server does not support variable substitution in web.xml files. Your best option would be to declare an <env-entry> and specify a binding while installing the application (either an actual value or a lookup-name to a value bound in the default namespace).
One of our old applications uses Struts-1.2 and EJB-2, generated with xdoclet 1.2.3. Maven 1 is used to build the application using java 1.4. The application has been running in weblogic 8.1 without any issues.
Now we are upgrading to Weblogic 10.3.6 which runs on java 6. When the application is deployed to Weblogic 10.3.6 we encounter the following error.
The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND problem:
cvc-minLength-valid.1.1: string length (0) is less than minLength facet (1) for filter-nameType
in namespace http://java.sun.com/xml/ns/javaee:<null>
I understand this error is because the web.xml file is missing the filter-name element for a Filter class.
The problem is web.xml is generated by the application as part of the build process and I have no idea where or how to add the filter-name element value. What should I do to get the filter-name element to be added to the generated web.xml?
(Note: There is no problem when deployed to Weblogic8.1. This happens only when trying to deploy on weblogic10.3.6.)
Any help will be much appreciated.
Thanks.
Got it going.
I had to add the following annotation to the filter class...
#web.filter name="FilterClassName"
web.xml generated the filter-name element after I added the above annotation.