classpath

Flyway not finding the migrations in a jar file

筅森魡賤 提交于 2019-12-08 04:57:07
问题 I implemented Flyway in a number of applications I support and it worked like a dream. However as soon as I deployed the applications to the test environment the migrations stopped working. After some investigation I found that the migrations are not being located by Flyway when they are loaded into a jar file, but when they are not zipped up (like when I am working in Eclipse or if I extract the jar into the classpath) it works as expected. Due to the plugin architecture of the applications

Explanation of Class.getResourceAsStream and how it is set in Tomcat for a simple Java web - app?

主宰稳场 提交于 2019-12-08 04:50:16
问题 I have a very simple java web-application which is deployed to Tomcat. In this application I have some code which goes like this: package com.mywebapp.hello; import javax.servlet.http.*; import java.io.*; public class PdfTwoServlet extends HttpServlet { public void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException { httpServletResponse.setContentType("application/pdf"); InputStream is = PdfTwoServlet.class.getResourceAsStream("/two.pdf");

How do jar manifest classpath and -classpath command line option combine

南楼画角 提交于 2019-12-08 04:44:29
问题 If I have an executable jar X.jar, with a classpath defined in a manifest, and I want to include other jars on the classpath than these, will java -classpath a.jar;b.jar;c.jar -jar X.jar COMBINE these classpaths or OVERRIDE the manifest classpath in X.jar with the classpath specified on the command line. (and if they will be combined, in what order will they be combined)? 回答1: They don't combine. If you specify 'java -jar', the -classpath option is ignored, and the effective CLASSPATH comes

ClassNotFoundException running GiraphRunner on a modified SimpleShortestPathsVertex

♀尐吖头ヾ 提交于 2019-12-08 03:47:19
问题 I'm relatively new to Giraph and I'm trying to get my Giraph edit-compile-deploy loop working for our code. I am able to run various examples inspired by http://blog.cloudera.com/blog/2014/02/how-to-write-and-run-giraph-jobs-on-hadoop/ , but I'm stuck with a ClassNotFoundException when running my modified version of the SimpleShortestPathsVertex Giraph example. I've tried various combinations of -libjars and HADOOP_CLASSPATH, but I'm out of ideas and I'd really appreciate your help. Details

Is there a Tomcat-like classloader that can be used standalone?

空扰寡人 提交于 2019-12-08 02:53:14
问题 I'm working with a Java sort-of-application-server (Smartfox) which can run multiple applications ("extensions") but has a very inconvenient classpath setup to go along with it, along with issues when trying to use SLF4J. To work around that I'd like to wrap my applications in their own classloaders. Such a containing classloader should be much like Tomcat's, in that it Can load classes from a directory containing JARs. Prefers classes from its own classpath over those from the parent Is

antlib and classpathref

瘦欲@ 提交于 2019-12-08 01:24:37
问题 I have the following build.xml file: <?xml version="1.0" encoding="UTF-8"?> <project name="Minimal" default="default" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> <path id= "libs.folder" > <fileset dir= "lib" > <include name= "*.jar" /> </fileset> </path> <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="libs.folder" /> <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="libs.folder"/> <artifact:pom id="pom.file"

How do I run a java class with arguments from a JSP page?

。_饼干妹妹 提交于 2019-12-08 00:35:00
问题 I have previously written a java class that was executed from a bash file, now I need to allow its execution from a JSP page using a Javascript/HTML button, I wonder how do I do that? First, my class looks like this: public class Sync { public static void main(String[] args) { //my content here } } This Sync class has been run from a bash script as follows: cd /root/tomcat/webapps/project/WEB-INF/classes/ echo "Executing first part..." /usr/local/java/bin/java classes/CLRSyncCLI 120.0.0.1 up

java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook

心已入冬 提交于 2019-12-07 21:03:01
问题 java.lang.NoClassDefFoundError:org/apache/poi/hssf/usermodel/HSSFWorkbook This is java web project. The java project is ok, but in web, I got this exception. Caused by: java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) maven dependency : <!-- apahce poi --> <dependency> <groupId>org.apache.poi<

GlassFish not loading connector

前提是你 提交于 2019-12-07 18:28:02
问题 I'm using GlassFish 3 and I can't seem to get it to recognize the MySql connector. The admin console always says: Ping Connection Pool for --- is Failed. Ping failed Exception - Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details. However, JPA can connect even with the error. The only downside is that I get resize pool exceptions (null). I've even placed the connector in the following folders: %GLASSFISH%

Running Mahout from the command line (CLASSPATH)

社会主义新天地 提交于 2019-12-07 16:10:29
问题 Complied Mahout successfully under Windows using Maven. I'm trying to run one of the examples from the command line and I don't get what I am doing wrong. Seems like a CLASSPATH problem. Let's say I want to run the GroupLensRecommenderEvaluatorRunner example. I go to the folder with the GroupLensRecommenderEvaluatorRunner.class file in it and execute: java -cp C:/mahout/core/target/classes;. org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommenderEvaluatorRunner It gives me the