Quartz 1.8.5 + OpenLiberty 18.0.0.4/ Websphere Liberty 17.0.0.4 java.lang.NoClassDefFoundError: oracle/sql/BLOB - quartz-scheduler

we get the following exception when using quartz 1.8.5 and the liberty server. While using a tomcat-server (7.0.81) the exception doesn't occur.
java.lang.NoClassDefFoundError: oracle/sql/BLOB
at org.quartz.impl.jdbcjobstore.oracle.OracleDelegate.writeDataToBlob(OracleDelegate.java:642)
at org.quartz.impl.jdbcjobstore.oracle.OracleDelegate.insertJobDetail(OracleDelegate.java:207)
pom.xml
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<!-- ASYNC-METHOD-INVOCATION -->
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-oracle</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>12.1.0.2.0</version>
<scope>provided</scope>
</dependency>
dataSource
<server>
<library id="oracleDriver">
<fileset dir="..\sw\oracle" includes="*.jar" scanInterval="120s" />
</library>
<!-- xa datasource -->
<dataSource id="ORACLE_DS_XA" jndiName="jdbc/xxx/xxx" pool-name="xxx">
<jdbcDriver libraryRef="oracleDriver" javax.sql.ConnectionPoolDataSource="oracle.jdbc.xa.client.OracleXADataSource" />
<properties.oracle URL="jdbc:oracle:thin:#localhost:1521:sid" password="user" user="password" />
<connectionManager minPoolSize="1" maxPoolSize="10" />
</dataSource>
<keyStore id="defaultKeyStore" password="password" />
</server>
What could be the reason for that exception? And how can we solve the problem?
Tell me if i should provide more information about our configuration.
TIA

I'm not really familiar with either, but if quartz is bundled in your application and needs access to the classes from your Oracle driver, then you need to expose the shared library to your application.
You'd do this by adding a <classloader> section to your <application> or <webapplication> block in your server.xml
E.g.
<application ...rest of your app configuration...>
<classloader commonLibraryRef="oracleDriver"/>
</application>
If you're currently deploying your app by putting it in the dropins directory, you'll have to change that to deploy your application to the apps directory instead and create an <application> or <webApplication> block in your server.xml.
Documentation links:
Deploying an app and adding the server.xml configuration
Reference for <application> element (includes classloader as a sub-element)
Reference for <webApplication> element (includes classloader as a sub-element)

Related

GWT content not showing on centOS 7.5

I'm working on a project which is built on GWT. When we deployed the project on centOS 6.9 version it works fine and all the content is accessible or visible. However, when we changed the OS version to centOS7.5. It deployed successfully but upon accessing the index page it only shows waiting gif and then unable to load the java content.
Some of my observations during inspect element are as follow.
CentOS7.5
In centOS7.5 the content div is empty. I've no clue why the content isn't rendering by GWT. Didn't see any exception or stack trace in tomcat logs. I've also updates the dependency version in pom.xml but still getting the same results.
CentOS6.9
Also I've observed the difference source hierarchy. Same rpm is installed on both servers. CentOS7.5 doesn't showing the top_banner.jpg and /image directory.
The pom.xml is as follow, whereas the gwt.version = 2.9.0
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
Application.gwt.xml
<!DOCTYPE module PUBLIC "//gwt-module/" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="agentportal">
<add-linker name="xsiframe" />
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE' />
<!-- Dependencies -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.seamless.gwt.components.Module' />
<inherits name='org.puremvc.PureMVC_Java_MultiCore' />
<inherits name='com.seamless.common.GWTModule' />
<inherits name='com.seamless.ers.interfaces.ersifcommon.GWTModule' />
<inherits name='com.seamless.ers.interfaces.ersifclient.GWTModule' />
<!-- ers-supportsystem-client-transport-ws -->
<inherits name="com.seamless.ers.components.supportsystem.interfaces.GWTModule"/>
<!-- ers-supportsystem-client -->
<inherits name="com.seamless.ers.interfaces.platform.clients.transaction.GWTModule"/>
<!-- ers-txe-client-model -->
<inherits name='com.seamless.ers.interfaces.platform.clients.GWTModule' />
<!-- Enable Debug IDs -->
<inherits name="com.google.gwt.user.Debug"/>
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
<extend-property name="log_level" values="DEBUG,WARN" />
<!-- Disable DIV logger -->
<set-property name="log_DivLogger" value="DISABLED" />
<!-- What languages should be supported? -->
<extend-property name="locale" values="en" />
<extend-property name="locale" values="fr"/>
<extend-property name="locale" values="ar"/>
<inherits name='com.google.gwt.user.theme.chrome.Chrome' />
<entry-point class='com.seamless.ers.client.agentPortal.client.Application' />
<source path="client">
<exclude name="**/tests/*" />
</source>
<stylesheet src='Application.css' />
<servlet
class="com.seamless.ers.client.agentPortal.server.AgentPortalServiceImpl"
path="/agentportal_service" />
<servlet path="/sessionService" class="com.seamless.ers.client.agentPortal.server.SessionServiceImpl"/>
</module>
Side by side difference of deployments on both servers
In the above image, I can clearly see that there is a different in /WEB-INF. The classes and the deploy directory is almost empty. Along with other marked
Can someone please guide me what I'm missing here and what's the root cause of this issue and why it's occurring on centOS7.5.
I was facing the same issue against GWT. The issue is at parser level of GWT. I had "_" as variable in my Screen.java class which extended com.google.gwt.user.client.ui:Composite
Upon renaming the variable name and refactoring the code the screen loaded for me. Please try doing it this way.

Wildfly Swarm and cxf-rt-transports-http

I'm trying to convert my project from EAP 6.3 to Wildfly Swarm...
I'm having some trouble with CXF.
I've got the fraction dependency:
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
And then later, I include this, because otherwise I get a "package org.apache.cxf.message does not exist" error in my Camel Processor code
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.9</version>
</dependency>
So if I include it, I get the error:
Apache CXF library (cxf-core-3.1.9.jar) detected in ws endpoint
deployment; either provide a proper deployment replacing embedded
libraries with container module dependencies or disable the
webservices subsystem for the current deployment adding a proper
jboss-deployment-structure.xml descriptor to it. The former approach
is recommended, as the latter approach causes most of the webservices
Java EE and any JBossWS specific functionality to be disabled.
Ok, so maybe there's a lib conflict between the camel-cxf modules and my jar... or it's not picking up my jboss-deployment-structure.xml file?
I've tried a few things as suggested by other posts.
I tried adding this to jboss-deployment-structure.xml under ${basedir}/src/main/webapp/WEB-INF and adding the xml file to the webResources of the maven-war-plugin.
<deployment>
<exclude-subsystems>
<subsystem name="webservices" />
</exclude-subsystems>
</deployment>
I've also tried adding this to jboss-deployment-structure.xml:
<dependencies>
<module name="org.apache.cxf" />
<module name="org.apache.cxf.impl" />
</dependencies>
But I keep getting that error. So I'm not sure how to resolve this conflict. Any idea?
One Approach is to use Jboss provided CXF libraries and set <scope>provided</scope> for cxf-rt-transports-http, so that it compiles and but not package the CXF dependencies .
You find more on Jboss specific configuration

Tag-lib issue with Struts2 and Tomcat 8

I have been searching for days to resolve this issue. I have used Struts2 for years, but now I am at a new company and trying to get Struts2 set up in my development environment. I don't have a choice as to what gets installed. We have an extremely controlled environment so it's totally out of my hands. However, I will attempt to install the environment on my personal computer and see what happens.
I have Eclipse LUNA (4.4.2), Apache Tomcat 8.0.38 and Java version 1.8.0_92 installed on my workstation. In Eclipse I have a Dynamic Web Project set up using Maven.
In Maven I just left the configuration as provided by the tutorial. It is bringing in javax.servlet-api v3.1.0 and struts2-core v2.3.20. The Maven Dependencies are included in the Web Deployment Assembly. I have checked the directory after Tomcat unpacks the WAR file. Struts2 core is definitely there.
I get no errors or warnings in the Eclipse project. However when I attempt to execute the first jsp I get an error 500 from Tomcat with "Unable to find taglib "s" for URI: /struts-tags".
My struts.xml file contains:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation"
value="false" />
<constant name="struts.devMode" value="true" />
<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />
<package name="default" namespace="/" extends="struts-default">
<action name="login"
class="org.o7planning.tutorial.struts2xml.action.LoginAction">
<result name="success">/WEB-INF/pages/UserInfo.jsp</result>
<result name="error">/WEB-INF/pages/Login.jsp</result>
</action>
</package>
</struts>
The web.xml file contains:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>Struts2XML</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/WEB-INF/pages/Login.jsp</welcome-file>
</web-app>
And the jsp contains:
<%# page contentType="text/html; charset=UTF-8"%>
<%# taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Struts 2 - Login Application </title>
</head>
<body>
<h2>Struts 2 - Login Application</h2>
<s:actionerror />
<s:form action="/login" method="post">
<s:textfield name="username" key="label.username" size="20" />
<s:password name="password" key="label.password" size="20" />
<s:submit method="execute" key="label.login" align="center" />
</s:form>
</body>
</html>
Every question I have found, and there have been many, has revolved around Eclipse. I don't have that problem. I'm not getting any Eclipse messages regarding this and all the files appear to be in the right place. So I'm stumped!!
Contents of the Maven pom file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.codejava.web</groupId>
<artifactId>SpringStrutsDemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.2.6.RELEASE</org.springframework-version>
<struts2-version>2.5.1</struts2-version>
<javax-servlet-api-version>3.1.0</javax-servlet-api-version>
<javax-servlet-jsp-version>2.3.1</javax-servlet-jsp-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<version>${struts2-version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${struts2-version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax-servlet-api-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>${javax-servlet-jsp-version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
List of jar files in WEB-INF/lib
aopalliance-1.0.jar
asm-3.3.jar
sm-commons-3.3.jar
sm-tree-3.3.jar
commons-fileupload-1.3.1.jar
commons-io-2.4.jar
commons-lang3-3.4.jar
commons-logging-1.2.jar
freemarker-2.3.23.jar
javassist-3.20.0-GA.jar
javax.servlet-api-3.1.0.jar
javax.servlet.jsp-api-2.3.1.jar
libs.txt
log4j-api-2.5.jar
ognl-3.1.8.jar
spring-aop-4.2.6.RELEASE.jar
spring-beans-4.2.6.RELEASE.jar
spring-context-4.2.6.RELEASE.jar
spring-context-support-4.2.6.RELEASE.jar
spring-core-4.2.6.RELEASE.jar
spring-expression-4.2.6.RELEASE.jar
spring-web-4.2.6.RELEASE.jar
spring-webmvc-4.2.6.RELEASE.jar
struts2-core-2.5.1.jar
struts2-spring-plugin-2.5.1.jar
I am unable to try other platforms on this machine. What we can install is completely out of our hands. We don't even have admin rights on our development workstations. What I have is what I have to use. We have a software portal that performs installs of "approved" software. If there is a mistake in the install I have to discover it, prove it and go to the support group and request a fix.

Class 'java.io.' is not present in JRE Emulation library INTELLIJ IDEA

I am working on a GWT project in IntelliJ IDEA 15.0.4. This project compileds and runs. But IntelliJ keeps telling me that java class files are not present in JRE Emulation Library.
Please help me! Is there something missing in my maven pom.xml?
Here are the error messages:
My pom.xml:
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<executable>/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/javac</executable>
<compilerVersion>1.8</compilerVersion>
</configuration>
</plugin>
Here are my IntelliJ project config:
Timesheet.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Timesheet'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name="com.vaadin.polymer.Elements"/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='com.campus.client.Timesheet' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<!-- <inherits name="com.google.gwt.user.theme.standard.Standard"/> -->
<inherits name="com.google.gwt.user.theme.clean.Clean"/>
<!-- For production, most teams prefer to set the default log level to `OFF` -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-OFF" />
<!-- For development, a default of `DEBUG` is recommended -->
<!-- <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" /> -->
</module>
Unless you have the full version of IntelliJ I would strongly suggest you to use Eclipse + GWT Plugin for GWT development.
This is the reference for GWT Jre emulated class, all that is in here will work on the client side:
http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_io
In your particular case seems like IntelliJ cannot find the String class either, that points out to a deeper configuration issue than a GWT related one.
I seemed to have this problem when I installed Oracle JDK 9 in Arch Linux and used that as the project SDK. After I uninstalled Oracle JDK 9 and installed OpenJDK 8, and set that as the project SDK, no errors occurred anymore. I wonder if either Java 9 or Oracle JDK is just not very nicely supported by GWT.
Another possible cause of error is that maybe I set up the SDK incorrectly. First I pointed the SDK path to /usr/lib/jvm/default-runtime, but later I changed it to the actual path (/usr/lib/jvm/java-8-openjdk).
This will help you solve your issue.. I had same issue and tried to add the dependencies..
<gwt.version>2.7.0</gwt.version>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>

Excluding httpclient/httpcore in jboss-deployment-structure

I recently updated apache httpclient to 4.5.1 and httpcore to 4.4.4, but for some reason my Jboss server has older versions of both (4.3.6). I'm pulling in the new versions via ivy, but they seem to be getting overwritten by the versions on the server. I've tried making my own jboss-deployment-structure.xml file, but it doesn't seem to be working and the documentation is scarce on exactly how this piece functions. At what level of specificity do I need to be blocking modules to prevent jboss loading dependencies that override ivy?
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.slf4j" />
<module name="org.apache.log4j" />
<module name="org.apache.commons.logging" />
<module name="org.apache.httpcomponents" />
</exclusions>
<dependencies>
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Progress update: looks like the application relies on jaxrs and xalan, which in turn pull in the dependencies. ugh.
From the hibernate 3 jboss-eap-quickstarts:
<exclusions>
<!-- Exclude container version of hibernate. By default its version 4, we want
bundled version 3 loaded -->
<module name="org.hibernate" slot="main" />
</exclusions>
In your build for your application in the dependencies that pull in jaxrs and xalan set the scope of httpclient and httpcore to provided.