classloader

Issue with XAResource class load in Jboss AS 7.1

余生颓废 提交于 2019-12-11 08:47:47
问题 I'm having a very annoying issue with a class being loaded two times by de ojdbc6 driver in Jboss AS 7.1. I have researched all through google and haven't found any answer. This is the problem: I have two ears being deployed in JBoss, one of them has in it's jboss-deployment-structure the dependency with the oracle module in JBoss, which depends on javax.api and javax.transaction.api. The other ear executes some liquibase change control on it's startup by using an ant task, this ant task has

Loading properties file from WEB-INF folder in a log4j appender

我的未来我决定 提交于 2019-12-11 08:24:23
问题 We're writing a custom log4j appender for our application. The appender should log its events to a database. Now the problem I'm having is setting up the database connection. Our jdbc settings are in a file called jdbc.properties which is located directly under the WEB-INF folder. I've tried accessing the properties file using the following code InputStream stream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("jdbc.properties"); ... but stream results in being null.

Who loads javax.swing.* classes in Equinox osgi container?

六月ゝ 毕业季﹏ 提交于 2019-12-11 08:12:53
问题 I read some equinox code and doc. I came to understand that, at present, only class loading for java.* packages are delegated to the parent classloader(given that i have not modified org.osgi.bootdelegation property, which by the way seems to be null). Then who is loading the javax.swing.* classes. I have not mentioned it anywhere in the imported packages/ required bundles, but still it loads just fine. I wanted to know who the heck is "formally" responsible for loading it? Thanks a lot in

Spring Boot / Security classloader issues with Keycloak run from terminal

偶尔善良 提交于 2019-12-11 07:21:54
问题 I use Spring Boot and Spring Security in combination with Keycloak. The build tool is gradle. When I run ./gradlew bootRun the application works flawless. If I use the resulting fat jar (i.e. java -jar myapp.jar ) the application will boot but I encounter an exception when the application tries to invoke some keyloak stuff: java.lang.IllegalArgumentException: org.keycloak.admin.client.resource.RealmsResource referenced from a method is not visible from class loader at java.base/java.lang

Classloader problem with EJB

允我心安 提交于 2019-12-11 07:09:03
问题 I'm working on a project which includes persistence library (JPA 1.2), EJB 3 and Web presentation layer (JSF). I develop application using Eclipse and application is published on Websphere Application Server Community Edition (Geronimo 2.1.4) through eclipse plugin (but the same thing happens if I publish manually). When publishing to server I get the following error: java.lang.NoClassDefFoundError: Could not fully load class: manager.administration.vehicles.VehicleTypeAdminBean due to

Does Java Class Linkage Resolution step OR Initialisation lead to loading of other resolved classes?

半腔热情 提交于 2019-12-11 06:51:51
问题 I was going through the JVM specification document and JLS , on the classloading mechanism in java . Here is what I understand . At first the when the main class is being asked to be loaded , it looks if the binary representation of the class has been already loaded or not , if not the class loader loads the class file from the disk . Linkage Steps: Verification ,Preparation and Resolution Initialisation. What I find confounding is , while in the Resolution and Initialisation steps if a class

Google Cloud Bigtable Java Client - tcnative errors

时光毁灭记忆、已成空白 提交于 2019-12-11 06:29:56
问题 I am trying to connect to Cloud Bigtable; however, I'm getting issues with netty-tcnative not being found. Maven dependencies: <dependency> <groupId>com.google.cloud.bigtable</groupId> <artifactId>bigtable-hbase-1.2</artifactId> <version>0.9.2</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>1.1.33.Fork19</version> </dependency> Error output: ERROR 2016-09-09 22:26:00,969 [main] com.google.cloud.bigtable.grpc

How to avoid NoClassDefFoundError thrown by unused code in Java

别等时光非礼了梦想. 提交于 2019-12-11 06:29:22
问题 The project I am working on is an API to support two different platforms. At runtime only one of the two platforms will actually be available on the classpath. For the most part, I have pretty easily been able to write code like this that works fine if(isPlatformOne(){ PlatformOne.doSomething(); } Even if PlatformOne does not exist at runtime, the check beforehand means the code does not run and no error will be thrown. This technique works for the VAST majority of situations however there is

What is a purpose of the SecureClassLoader?

放肆的年华 提交于 2019-12-11 06:15:13
问题 I was exploring Java classloaders then I faced the SecureClassLoader. After a reviewing of its source code and reading some articles I realized that I am not able to understand it's secure feature and a scope of utilizing. Could anyone explain what the SecureClassLoader is used for? Why is it "secure"? Thank you. 回答1: The Java security model is based on classes having specific permissions. When some method attempts to perform a privileged action (for example, open a file on the file system or

Java separate System.out for separate Classpath

社会主义新天地 提交于 2019-12-11 05:25:36
问题 I am developing an application which needs to call some Jenkins instances, to do this I am using the jenkins-cli .jar I could be calling the jar using the commandline to easily extract its output. Then however I need to parse exceptions myself. To properly handle exceptions I am now invoking the main method of the jar via reflection: URLClassLoader jenkinsClassloader = new URLClassLoader(new URL[]{"UrlToJenkins-Cli.jar"}, getClass().getClassLoader()); Class<?> jenkinsCli = Class.forName (