classpath

Classpath issues running Tika on Spark

邮差的信 提交于 2019-12-07 15:53:44
问题 I try to process a bunch of files in Tika. The number of files is in the thousands so I decided to build an RDD of files and let Spark distribute the workload. Unfortunatly I get multiple NoClassDefFound Exceptions. This is my sbt file: name := "TikaFileParser" version := "0.1" scalaVersion := "2.11.7" libraryDependencies += "org.apache.spark" %% "spark-core" % "1.5.1" % "provided" libraryDependencies += "org.apache.tika" % "tika-core" % "1.11" libraryDependencies += "org.apache.tika" % "tika

How to share code between two projects?

断了今生、忘了曾经 提交于 2019-12-07 07:35:11
问题 I have two Java projects called A and B. Both of them are web apps deployed as war files. I created them in Eclipse workspace separately. Project B uses a class in project A named MusicMapper . I added the project A to project B's build path in Eclipse as suggested in this post. So now project B can compile without any errors and the class MusicMapper can be seen in project B by importing it in project B: import com.projectA.MusicMapper; Everything seems to be fine before I launched the web

set resource in spring configuration file

六眼飞鱼酱① 提交于 2019-12-07 07:14:48
问题 i am trying to config dozer in spring configuration. when using xml config it would be like <bean class="org.dozer.spring.DozerBeanMapperFactoryBean"> <property name="mappingFiles" value="classpath*:dozer/**/*.dzr.xml"/> </bean> how can i define resources in config file. i tried using ctx.getResource() but i cannot access to ApplicationContext in Configuration class. i tried ContextRefreshedEvent and add resources from there, but still no luck. (afterPropertiesSet is already called and added

Postgres : No suitable Driver found for jdbc

岁酱吖の 提交于 2019-12-07 04:56:55
问题 I know this might be a possible duplicate of question posted here. Sorry for that.Here is the code i wrote for Database connection try{ Class.forName("org.postgresql.Driver"); } catch(ClassNotFoundException e) { e.printStackTrace(); } try{ String URL = "jdbc:posgresql://localhost:5432/postgres"; String USER = "postgres"; String PASS = "postgres"; Connection conn = DriverManager.getConnection(URL, USER, PASS); Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("Select * from

manage conflict on java classpath

∥☆過路亽.° 提交于 2019-12-07 02:44:17
问题 I expose my context : I have two Java programs that run on a unique Weblogic Server : program A and program B. These ones are launched by two ksh : programA.ksh and programB.ksh Both need C.jar but in different versions (but with exactly the same package and classes) : program A need C-1.0.jar program B need C-2.0.jar I precise that both programs share the same weblogic classpath. So, my classpath contains in that order : ..... C-1.0.jar C-2.0.jar ..... How can I do so that each program finds

defining root classpath for class.getResource()

安稳与你 提交于 2019-12-07 00:44:06
问题 I'm using java in Eclipse (windows), and I'm trying to use: myClass.getResource("/image.jpg"), While image.jpg exists in the root loacation "myProject/". It returns null. I checked many other threads but none of them resolved my issue. So I tried to evaluate this: this.getClass().getResource("/").getPath(); and it returned "myProject/build/classes". So I checked the project's configuration for this dir, and found the exact same dir under Java Build Path --> Source --> Default output folder My

Impacts of having unused JAR files in CLASSPATH

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 23:29:14
问题 I've read so many Q&A here about tools available to find out unused JARs, such as: loosejar Classpath Helper My question here is, are there any impacts (such as loading of classes into memory, performance, etc.) of having unused JARs in the classpath either at compile time or run time? Question applies to both running as a Standalone program and Web Server (Apache Tomcat), though I initially thought about only Standalone programs. NOTE: I'm running JDK 6u32 (64-bit). 回答1: Are there any

Use Eclipse classpath variable to replace absolute “sourcepath” path?

[亡魂溺海] 提交于 2019-12-06 22:48:25
问题 I would like to use an Eclipse classpath variable to resolve the attached source JAR file for a library in my classpath. This is the contents of my current ".classpath" file in Elcipse (Indigo): <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry exported="true" kind="lib" path="lib/ApacheCommons/commons-logging.jar"/> <classpathentry exported=

getResource() is returning null with Gradle project

你。 提交于 2019-12-06 20:09:37
问题 I'm aware there are several other questions regarding this... Class.getResource() returns null Java - class.getResource returns null Calling context.getResources() returns null getClassLoader().getResource(filepath) returns a null pointer But my problems seems to be a bit different because I seem to have all of the necessary things to NOT have this problem. The code: this.getClass().getResource("checkstyle_whitespace.xml"); // null The issue is that I've verified my classpath by inspecting

Problems with setting the classpath in ant

孤人 提交于 2019-12-06 18:58:23
问题 I'm having problems getting my Java program to run (it uses some third party JARs). I can compile it fine but when I call my run target in ant it says it can't find the class that I told it run in the classpath. Here's what my build.xml looks like: <project basedir="." default="build"> <property name="build" value="build" /> <property name="src" value="." /> <property name="lib" value="lib" /> <path id="classpath"> <fileset dir="${lib}"> <include name="**/*.jar" /> </fileset> <fileset dir="$