classpath

Solving java classpath hell in legacy junit test suite

旧巷老猫 提交于 2019-12-23 07:45:46
问题 Suppose I have a legacy JUnit test suite that includes the following tests: public class AwesomeTest { public void testBusinessLogic() { ... [awesome mocking library] ... } } public class AmazingTest { public void testBusinessProcess() { ... [amazing xml operation] ... } } Now assume that Awesome Mocking library relies on Awesome BCEL bytecode generation library which contains the class org.useful.XMLClass and this library has version 1 of XMLClass. Now assume that Amazing Xml operation

Solving java classpath hell in legacy junit test suite

回眸只為那壹抹淺笑 提交于 2019-12-23 07:45:45
问题 Suppose I have a legacy JUnit test suite that includes the following tests: public class AwesomeTest { public void testBusinessLogic() { ... [awesome mocking library] ... } } public class AmazingTest { public void testBusinessProcess() { ... [amazing xml operation] ... } } Now assume that Awesome Mocking library relies on Awesome BCEL bytecode generation library which contains the class org.useful.XMLClass and this library has version 1 of XMLClass. Now assume that Amazing Xml operation

Listing available classes in current classpath using a command line tool

久未见 提交于 2019-12-23 05:13:48
问题 I need to check if a specific class is available from current directory using a default JRE/JDK command line tool. I could build my own class to list it or check if a specific class is reacheble from current directory and current CLASSPATH environment variable, but this option is not available since I need to check if a specific class name is available or not in a protected production environment (read only). 回答1: You can use javap : $ javap java.lang.String Compiled from "String.java" public

Grails stops at “Configuring classpath” even at a helloworld project

北慕城南 提交于 2019-12-23 04:15:13
问题 I want to learn Grails, so I started with a Hello-World Projekt. I tried everything in the cmd.exe and in STS. I have Windows7. First i wrote grails create-app helloworld command Then i swaped in the new helloworld\ directory and wrote grails run-app But the command-line doesn't go furthen then Configuring classpath I watched in other forums but nothing helped. I am sitting in a companys-internet. Does this cause the fault ? Fault if log level is set on verbose (only the last few lines -

NoClassDefFoundError with Executable Jar

跟風遠走 提交于 2019-12-23 04:08:19
问题 Probably a very usual problem with exec jar. I am trying to create and run an executable jar and its driving me crazy. I have couple of classes(with package stmts), one of which has a main method, a simple empty constructor and ofcourse few biz methods, these form part of a small eclipse project. I am bundling both these and a manifest file into a jar(arc.jar) using a build.xml. My program uses jdom library and also references from one of my other eclipse projects, so I am including both the

database connectivity?

邮差的信 提交于 2019-12-23 02:39:07
问题 How to establish SQL 2005 database connectivity with Java application. Actually I don't know how to set path for JDBC. Any help would be great. 回答1: Download the jdbc driver from http://www.microsoft.com/sqlserver/2005/en/us/java-database-connectivity.aspx. You can either download the Windows or Unix version. It does not really matter which one you use. If you chosed the Windows version, run the downloaded exe file; this will create a directory called Microsoft SQL Server 2005 JDBC Driver in

META-INF/persistence.xml cannot be opened because it does not exist

三世轮回 提交于 2019-12-22 17:23:26
问题 I'm creating a basic spring-maven project that should run as a java application (in process, not over a web server). My application context resides under the resources folder which is in my classpath: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www

META-INF/persistence.xml cannot be opened because it does not exist

旧巷老猫 提交于 2019-12-22 17:23:09
问题 I'm creating a basic spring-maven project that should run as a java application (in process, not over a web server). My application context resides under the resources folder which is in my classpath: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www

Can I pre-empt the class path? [duplicate]

耗尽温柔 提交于 2019-12-22 16:45:38
问题 This question already has answers here : Is it possible to replace the version of the JAXB implementation in Java JRE 1.6 SE? (3 answers) Closed 6 years ago . I have a library that is a drop-in extension of a commercial product. That product is several years old and uses Sun's JAXB-2.0 libraries. My library uses JAXB and I'm having a very bizarre error. What might cause "JAXBElement Does not have a no-arg default constructor"? I've discovered that this is caused by a bug in the older library.

Xtext Project: Add Jar Libraries with the Project Wizard Manager into the Classpath/Referenced Libaries of the clients Project

眉间皱痕 提交于 2019-12-22 13:59:47
问题 I have been searching quite a lot for this problem, however I can't really find a proper solution or a how-to manage this one. I have written a simple DSL for generating some code via Xtext and Xtend. I optionally use the project wizard in the UI project of Xtext to be able to create an individual project for my grammar and plugin. I am able to create the project with ease, however I still need to add some important dependencies into my class path of the clients project. It seems to be a bit