cxf-codegen-plugin illegal configuration-file syntax - cxf

I am trying to update some web services code developed for Java 6 to Java 8. The modules use the maven cxf-codegen-plugin. The Java 6 version used cxf version 2.2.2. I was able to get it working with Java 7 by updating cxf to 2.7.9 but haven't be able to build under Java 8. I tried updating cxf to 3.0.3 but still get this error:
XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sum.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.xml.xpath.XPathFactory: jar:file:/c:/Documents%20and%20Settings/Kevin/.m2/repository/saxon/saxon-xpath/8.9.0.3/saxon-xpath-8.9.0.3.jar!META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
I am using jdk 1.8.0_31, maven 3.0.3 and cxf 3.0.3.

The problem comes from an incompatible version of saxon-he. It can easily be solved by adding a fixed version to the classpath oth the maven plugin (as dependency):
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf-version}</version>
<dependencies>
<dependency>
<groupId>org.daisy.libs</groupId>
<artifactId>saxon-he</artifactId>
<version>9.5.1.5</version>
</dependency>
</dependencies>
<executions>

Related

jdk17 application not able to connect to sybase

This application runs without any error with jdk8.
jdk version jdk17
jConnect dependency
<dependency>
<groupId>com.sybase.jconnect</groupId>
<artifactId>jconn4</artifactId>
<version>7.07-27307</version>
</dependency>
oracle dependency
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8_g</artifactId>
<version>12.2.0.1</version>
</dependency>
Error : Could not load JDBC driver class [com.sybase.jdbc4.jdbc.SybDriver]
I tried by upgrading jConnect jar to 16.039-27463 and ojdbc to ojdbc10 version 19.3 but of no use.
Did anyone face this before and how got it fixed.

How to start solr using maven?

I am using solr 5.3.1. Is there any way to launch solr using maven 3.1 .1 using pom.xml.
I tried ny putting solr core in pom.xml .I could see that the solr core's jar and jetty jar and other solr transitive dependencies getting downloaded in the folder maven dependencies under my eclipse project.But how to launch solr using maven command?
You can start solr as [EmbeddedSolrServer]. For that you need to add solr-core and solr-solrj dependencies as below
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>5.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>5.3.1</version>
</dependency>
In Java code, you need to start the solr server as EmbeddedSolrServer mode. as below.
CoreContainer coreContainer = new CoreContainer(<solrHome-abosolute-path>);
coreContainer.load();
this.solrClient = new EmbeddedSolrServer(coreContainer, <solrCore-name>);
Then you can use solrClient inside the project to do search and indexing operations. This can only use within the project, and there is no admin console in embedded solr mode.
http://lucene.apache.org/solr/5_3_1/solr-core/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html

Is there any SolrJ documentation available for connecting with Solr 4.0 or ahead

I'm unable to connect to my Solr instance on Tomcat from SolrJ. I've been through the documentation shown at "http://wiki.apache.org/solr/Solrj" , but its pretty outdated - primarily because it has no reference on Solr cores. I'm wondering if somebody could point me to the latest documentation OR advise on how to connect SolrJ with Solr4.0 or ahead - although my instance is running just 1 core for now.
Here's my connection string: "localhost:8080/solr-example/collection1/". Do you know which jars to add along with solrj? Thats where the trouble might be. For examples, the SolrJ wiki references a jar called commons-codec-1.3.jar which is not to be found anywhere, in the solr 4.0 zip file.
Calling Solr from Java with SolrJ
You can specify the Core directly in the URL.
HttpSolrServer server = new HttpSolrServer("http://localhost:8080/solr/my_core");
SolrQuery solrQuery = new SolrQuery();
solrQuery.setQuery(q);
solrQuery.setStart(start);
solrQuery.setRows(rows);
QueryResponse response = server.query(solrQuery);
HttpSolrServer is reusable for more queries.
The communication between the Solr Server and SolrJ happens via HTTP with a custom binary format. Can you Browse the Solr Web Admin at http://localhost:8080/solr? Depending on your installation, you might need to adjust the port (8080 is default on Tomcat, jetty uses 8983).
Also, did you deploy Solr with a generic name or did you include the Version? Than your URL would be http://localhost:8080/solr-4.2.1/my_core
Dependencies
These are the minimum dependencies you need for using SolrJ. Add these to your pom.xml, if you are using maven.
<dependency>
<artifactId>solr-solrj</artifactId>
<groupId>org.apache.solr</groupId>
<version>4.2.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
If you are not using maven, you need the following jars:
solr-solrj-4.2.0
zookeeper-3.4.5
commons-io-2.1
httpclient-4.2.3
httpcore-4.2.2
commons-codec-1.6
httpmime-4.2.3
wstx-asl-3.2.3
slf4j-simple-1.5.6
slf4j-api-1.7.2
commons-logging-1.1.1

How to build GAE application for SDK v1.7.5 (with Maven)

I'm trying to make GAE 1.7.5 work with Maven:
<properties>
<gae.version>1.7.5</gae.version>
<gae-runtime.version>1.7.5.1</gae-runtime.version>
<maven.gae.plugin.version>0.9.6</maven.gae.plugin.version>
</properties>
<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>${maven.gae.plugin.version}</version>
<configuration>
<unpackVersion>${gae.version}</unpackVersion>
<serverId>appengine.google.com</serverId>
<appDir>${webappDirectory}</appDir>
</configuration>
<dependencies>
<dependency>
<groupId>net.kindleit</groupId>
<artifactId>gae-runtime</artifactId>
<version>${gae-runtime.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
However there is this problem:
[WARNING] The POM for net.kindleit:maven-gae-plugin:jar:0.9.6 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for net.kindleit:maven-gae-plugin:0.9.6: Plugin net.kindleit:maven-gae-plugin:0.9.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for net.kindleit:maven-gae-plugin:jar:0.9.6
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Then eventually, will end into BUILD FAILURE.
How to build my GAE against version 1.7.5 with Maven?
You can use the App Engine Maven Plugin. We also have a guestbook sample app on github.
The official appengine-maven-plugin supports 1.7.6, you could use the 1.7.5 version if you want, but 1.7.6 is current now.

Flyway Unable to instantiate jdbc driver

Just starting out with Flyway and Spring 3.0. So far, all I did was add the Flyway dependency and plugin to my pom.xml. Next, I tried running mvn flyway:status in the command line. However, it complains that it is unable to instantiate the jdbc driver (I'm using postgres).
Does anybody know what might be causing this? I'm using Springsource Tool Suite to develop my app. The postgres driver is located under WEB-INF/lib/postgresql-9.1-902.jdbc4.jar
Any help is greatly appreciated! Thanks!
For the Maven plugin to work you must:
Add this dependency to your project (or just the plugin):
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
and configure the plugin like this:
<plugin>
<groupId>com.googlecode.flyway</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://...</url>
<user>...</user>
<password>...</password>
</configuration>
</plugin>
You also have to provide the Postgresql jdbc drivers as a maven dependency:
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-902.jdbc4</version>
</dependency>

Resources