JSP support in Jetty 9.3 - java

I'm trying to upgrade embedded Jetty to the latest version (9.3.2.v20150730 as of now) from an older release (9.3.0.M1).
I'm using JSP and current maven dependency is as follows:
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>9.3.0.M1</version>
</dependency>
However I can't find a new version for this dependency in maven central.
Looks like they have not released new jetty-jsp artifacts after 9.3.0.M1 for Jetty 9.3. New versions for all other jetty-related artifacts are available.
What is the alternative I should use for JSP support with latest Jetty version?

I got the answer from jett-users mailing list. Updated dependency is:
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
<version>${jetty.version}</version>
</dependency>
Also, from jetty-announce list:
The 9.2 release has switched to using the Apache version of Jasper for
JSP and JSTL. Early releases of Jetty used these implementations,
but switched to Glassfish when it became the reference implementation.
However the Apache version is now more rigorously maintained and hence
we have switched back. Currently we are using a slightly modified
version of 8.0.3, however our modifications have been contributed
back to apache and have been accepted for their 8.0.9 release, so we
will soon switch to using a standard jar from Apache.
Apparently they have switched back to standard jar from Apache.

Related

Glassfish 5.1 missing modules from previous versions

We have an application running on Glassfish 5.0.1 and before that 4.1.1 versions. Recently server is updated to Glassfish 5.1.0 and our application can not be compiled due to the missing of javax.inject.Inject. This relevant jar was in the previous Glassfish versions (in the module folder).
So I'd like to hear that in glassfish 5.1 should we add this jar as an external library or is there a way to make this work in the latest glassfish ?
For GlassFish 5.1 the maven coordinates of dependencies are now jakarta.* instead of javax.*. So for the javax.inject.Inject annotation use the maven dependency
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>1.0.3</version>
</dependency>

org.elasticsearch.client.RequestOptions is only dependency not found in elasticsearch client

For some bizarre reason, the following import is not being found by maven. I am not sure if it's removed from the dependency I get from maven or not. Could I please get a look at why it's not being found
import org.elasticsearch.client.RequestOptions;
I am using elastic version 6.3.2 with the high-level JAVA REST client as 6.3.2 also. My POM looks like this below.
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.3.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.3.2</version>
</dependency>
RequestOptions was introduced in version 6.4 of the Rest High-Level client.
So you need to upgrade your client to 6.4.0 at least. That version might work with ES 6.3.2 but there might be some incompatibility issues as only forward compatibility is guaranteed.
The High Level Client is guaranteed to be able to communicate with any Elasticsearch node running on the same major version and greater or equal minor version.

Selenium 3.0.x with HTMLUnitDriver

I have selenium-java 3.0.1 in my Maven project. I have read that this version does not come packaged with HTMLUnitDriver. So, I have separately included selenium-htmlunit-driver 2.52.0 in my pom (the latest version available). However, when I do this, I get the following exception on test run:
org.openqa.selenium.WebDriverException: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.sslcontext
According to this link, including the selenium-java and selenium-htmlunit-driver dependencies should be sufficient. In some scenarios, the standalone server may need to be included as well, which is not the case for my project. I tried it anyway, and that didn't work either.
selenium-htmlunit-driver 2.52.0 is internally dependent on org.apache.httpcomponents 4.5.1.
selenium-java 2.47.0 uses htmlunit-driver 2.47.0 which uses org.apache.httpcomponents 4.4.1. When I use these versions, everything works correctly.
So my question is, can HTMLUnitDriver not be used with Selenium 3.0.x at all? Or is my understanding completely wrong here?
Selenium has changed artifact id. Use htmlunit-driver instead.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.23.2</version>
</dependency>
See also:
https://github.com/SeleniumHQ/htmlunit-driver

Jython 2.7.0 with jersey

I was using Jython standalone version 2.5.3 in my REST application. It was working fine. When I upgraded to Jython 2.7.0, I am getting the following exception,
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.python.apache.xalan.processor.TransformerFactoryImpl not found
Java xml classes were packaged and distributed with version 2.7.0. But if I understand it correctly Java SE comes with these classes. This issue is raised as a bug here. In order to avoid this exception add the xalan processor dependency in your pom.xml
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
Another solution would be to upgrade to the latest version of the jython-standalone jar. This issue is fixed in the latest release 2.7.1

SolrJ version mismatch while merging 2 projects

I have 2 java projects which developed using Solrj.
Project 1 -> using solrj 4.10.1
Project 2 -> using solrj 5.2.1
Now, I am trying to merge both the projects to single project.
I tried including both version of jars in maven, still same issue.
If I try including only major version, I'm getting some of the classes(4.10.1) are deprecated and some interfaces are unavailable in it.
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>4.10.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>5.2.1</version>
</dependency>
In simple:Few Packages of same project uses different jars.
example:
Package1/Module1 uses : Solrj Jar version 4.10.1
Package2 uses : Solrj Jar version 5.2.1
Is there any way to merge this projects in best way, without change old project ? I am totally stuck here.
If both projects are under the same Maven project (pom.xml), you need to update (or downgrade) one of the implementation. Both need to use the same SolrJ version. It shouldn't be too hard to update. You can find some details in Solr Wiki.

Categories