Adding spring-boot library produce "Unable to start EmbeddedWebApplicationContex"? - java

I have a single class application
#Configuration
#ComponentScan
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class);
}
}
It's works pretty well (doing nothing) with the following dependencies (Ivy notation used)
<dependency org="org.springframework.boot" name="spring-boot-starter" rev="1.1.7.RELEASE"/>
<dependency org="org.springframework" name="spring-context" rev="4.1.0.RELEASE"/>
<dependency org="org.springframework" name="spring-beans" rev="4.1.1.RELEASE"/>
But when I add <dependency org="org.springframework.boot" name="spring-boot" rev="1.1.7.RELEASE"/> I get the following exception.
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:124)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
INFO | jvm 1 | 2014/10/10 17:45:49 | at one.video.streaming.Main.main(Main.java:48)
INFO | jvm 1 | 2014/10/10 17:45:49 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2014/10/10 17:45:49 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 1 | 2014/10/10 17:45:49 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2014/10/10 17:45:49 | at java.lang.reflect.Method.invoke(Method.java:483)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:136)
INFO | jvm 1 | 2014/10/10 17:45:49 | at java.lang.Thread.run(Thread.java:745)
INFO | jvm 1 | 2014/10/10 17:45:49 | Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:174)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:147)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:121)
INFO | jvm 1 | 2014/10/10 17:45:49 | ... 13 common frames omitted
My goal is not to add spring-boot library, I don't need it, but I want to understand how does Spring work and why it starts to trying to use some web stuff for my app.

Related

Error java.net.UnknownHostException: pubsub.googleapis.com Name or service not know

Java client with code to publish messages to pubsub gcp topic. This code works fine in my localhost but when I try runnnig my jar on linux and with proxy this error is shown:
INFO | jvm 1 | 2022/10/25 12:28:38 | WARNING: [Channel<1>: (pubsub.googleapis.com:443)] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Unable to resolve host pubsub.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: pubsub.googleapis.com: Name or service not known
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.grpclb.GrpclbNameResolver.doResolve(GrpclbNameResolver.java:63)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.lang.Thread.run(Thread.java:750)
INFO | jvm 1 | 2022/10/25 12:28:38 | Caused by: java.net.UnknownHostException: pubsub.googleapis.com: Name or service not known
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAllByName0(InetAddress.java:1277)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAllByName(InetAddress.java:1193)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAllByName(InetAddress.java:1127)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:631)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:219)
INFO | jvm 1 | 2022/10/25 12:28:38 | ... 6 more`
This is my code:
public HttpTransportFactory getHttpTranpostFactory(String proxy, String puerto) {
Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy, Integer.parseInt(puerto)));
HttpTransport httpTransport = new NetHttpTransport.Builder().setProxy(prox).build();
return new HttpTransportFactory() {
#Override
public HttpTransport create() {
return httpTransport;
}
};
}`
In main class:
HttpTransportFactory httpTransport = getHttpTranpostFactory("myvalidproxy.com", "8080");
credentialsProvider = FixedCredentialsProvider.create(
ServiceAccountCredentials.fromStream(new FileInputStream("/path/to/accountservice"), httpTransport));
TopicName topicName = TopicName.of("avalidgcpproject","avalidtopic");
Publisher publisher = Publisher.newBuilder(topicName)
.setEnableCompression(true)
.setCompressionBytesThreshold(100000L)
.setCredentialsProvider(credentialsProvider)
.build();
ByteString data = ByteString.copyFromUtf8("Hello World!");
PubsubMessage pubsubMessage = PubsubMessage.newBuilder()
.setData(data)
.build();
ApiFuture<String> messageIdFuture = publisher.publish(pubsubMessage); //Error is in this line
System.out.println(messageIdFuture.get());`
Maven dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.120.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.cloud/google-cloud-core -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
<version>2.8.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220320</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.3.7</version>
</dependency>
Error is on ApiFuture messageIdFuture = publisher.publish(pubsubMessage); line
When I generate the jar, I have to change the io.grpc.LoadBalancerProvider inside META-INF/services file with content: io.grpc.internal.PickFirstLoadBalancerProvider because if I dont do that, jar thrown another exception.

How to use JAMES (Java Mail Server) in windows 11 JDK 17

I want to find an email server implementation, convert the code to a war file like all my other apps.
The JAMES project seems so ... finished. But for years I couldn't even started it.
Milestones:
i have extracted james-server-jpa-guice.zip file from https://james.apache.org/download.cgi and run:
D:\james>java -classpath 'james-server-jpa-app.lib/*' -javaagent:james-server-jpa-app.lib/openjpa-3.2.0.jar -Dlogback.configurationFile=conf/logback.xml -Dworking.directory=. org.apache.james.JPAJamesServerMain
Some product derivations are being skipped. For information about product derivation status, run:
java org.apache.openjpa.lib.conf.ProductDerivations
org.apache.openjpa.persistence.PersistenceProductDerivation:java.lang.NoClassDefFoundError: javax/persistence/spi/PersistenceUnitInfo
Error: Could not find or load main class org.apache.james.JPAJamesServerMain
Caused by: java.lang.ClassNotFoundException: org.apache.james.JPAJamesServerMain
no luck.
Even though i don't understand Spring, I extracted james-server-app-3.7.0-app.zip from https://james.apache.org/download.cgi and run in admin mode:
D:\james\bin>james console
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 2022-04-24 15:52:29,840 main ERROR Unable to create file ${sys:app.home}/log/springframework.log java.io.IOException: Dosya ad², dizin ad² veya birim etiketi s÷zdizimi hatal²
jvm 1 | at java.base/java.io.WinNTFileSystem.canonicalize0(Native Method)
jvm 1 | at java.base/java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:417)
jvm 1 | at java.base/java.io.File.getCanonicalPath(File.java:626)
jvm 1 | at java.base/java.io.File.getCanonicalFile(File.java:651)
jvm 1 | at org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:135)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:732)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:716)
jvm 1 | at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:114)
jvm 1 | at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:146)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
jvm 1 | at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
jvm 1 | at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
jvm 1 | at org.apache.james.app.spring.JamesAppSpringMain.<clinit>(JamesAppSpringMain.java:34)
jvm 1 | at java.base/java.lang.Class.forName0(Native Method)
jvm 1 | at java.base/java.lang.Class.forName(Class.java:375)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.<init>(WrapperSimpleApp.java:147)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.main(WrapperSimpleApp.java:485)
jvm 1 |
jvm 1 | 2022-04-24 15:52:29,843 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory#44a59da3] unable to create manager for [${sys:app.home}/log/springframework.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData#27e47833[pattern=${sys:app.home}/log/springframework.%d{yyyy-MM-dd}-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=%d{dd-MMM-yyyy HH:mm:ss.SSS} %level [%t] %C.%M:%L - %msg%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory#44a59da3] unable to create manager for [${sys:app.home}/log/springframework.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData#27e47833[pattern=${sys:app.home}/log/springframework.%d{yyyy-MM-dd}-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=%d{dd-MMM-yyyy HH:mm:ss.SSS} %level [%t] %C.%M:%L - %msg%n, filePermissions=null, fileOwner=null]]
jvm 1 | at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:116)
jvm 1 | at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:146)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
jvm 1 | at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
jvm 1 | at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
jvm 1 | at org.apache.james.app.spring.JamesAppSpringMain.<clinit>(JamesAppSpringMain.java:34)
jvm 1 | at java.base/java.lang.Class.forName0(Native Method)
jvm 1 | at java.base/java.lang.Class.forName(Class.java:375)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.<init>(WrapperSimpleApp.java:147)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.main(WrapperSimpleApp.java:485)
jvm 1 |
jvm 1 | 2022-04-24 15:52:29,947 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:236)
jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:134)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
jvm 1 | at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
jvm 1 | at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
jvm 1 | at org.apache.james.app.spring.JamesAppSpringMain.<clinit>(JamesAppSpringMain.java:34)
jvm 1 | at java.base/java.lang.Class.forName0(Native Method)
jvm 1 | at java.base/java.lang.Class.forName(Class.java:375)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.<init>(WrapperSimpleApp.java:147)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.main(WrapperSimpleApp.java:485)
jvm 1 |
jvm 1 | 2022-04-24 15:52:29,954 main ERROR Unable to create file ${sys:app.home}/log/openjpa.log java.io.IOException: Dosya ad², dizin ad² veya birim etiketi s÷zdizimi hatal²
jvm 1 | at java.base/java.io.WinNTFileSystem.canonicalize0(Native Method)
jvm 1 | at java.base/java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:417)
jvm 1 | at java.base/java.io.File.getCanonicalPath(File.java:626)
jvm 1 | at java.base/java.io.File.getCanonicalFile(File.java:651)
jvm 1 | at org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:135)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:732)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:716)
jvm 1 | at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:114)
jvm 1 | at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:146)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
jvm 1 | at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
jvm 1 | at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
jvm 1 | at org.apache.james.app.spring.JamesAppSpringMain.<clinit>(JamesAppSpringMain.java:34)
jvm 1 | at java.base/java.lang.Class.forName0(Native Method)
jvm 1 | at java.base/java.lang.Class.forName(Class.java:375)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.<init>(WrapperSimpleApp.java:147)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.main(WrapperSimpleApp.java:485)
jvm 1 |
jvm 1 | 2022-04-24 15:52:29,966 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory#44a59da3] unable to create manager for [${sys:app.home}/log/openjpa.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData#6c61a903[pattern=${sys:app.home}/log/openjpa.%d{yyyy-MM-dd}-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=%d{dd-MMM-yyyy HH:mm:ss.SSS} %level [%t] %C.%M:%L - %msg%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory#44a59da3] unable to create manager for [${sys:app.home}/log/openjpa.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData#6c61a903[pattern=${sys:app.home}/log/openjpa.%d{yyyy-MM-dd}-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=%d{dd-MMM-yyyy HH:mm:ss.SSS} %level [%t] %C.%M:%L - %msg%n, filePermissions=null, fileOwner=null]]
jvm 1 | at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:116)
jvm 1 | at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
jvm 1 | at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:146)
jvm 1 | at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
jvm 1 | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
jvm 1 | at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
jvm 1 | at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
jvm 1 | at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
jvm 1 | at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
jvm 1 | at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
jvm 1 | at org.apache.james.app.spring.JamesAppSpringMain.<clinit>(JamesAppSpringMain.java:34)
jvm 1 | at java.base/java.lang.Class.forName0(Native Method)
jvm 1 | at java.base/java.lang.Class.forName(Class.java:375)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.<init>(WrapperSimpleApp.java:147)
jvm 1 | at
.........
jvm 1 | 24-Nis-2022 15:52:37.034 INFO [WrapperSimpleAppMain] org.springframework.jmx.export.MBeanExporter.registerBeanInstance:672 - Located MBean 'org.apache.james:type=component,name=mailboxcopier': registering with JMX server as MBean [org.apache.james:type=component,name=mailboxcopier]
jvm 1 | 24-Nis-2022 15:52:37.034 INFO [WrapperSimpleAppMain] org.springframework.jmx.export.MBeanExporter.registerBeanInstance:672 - Located MBean 'org.apache.james:type=component,name=quotamanagerbean': registering with JMX server as MBean [org.apache.james:type=component,name=quotamanagerbean]
jvm 1 | 24-Nis-2022 15:52:37.035 INFO [WrapperSimpleAppMain] org.springframework.jmx.export.MBeanExporter.registerBeanInstance:672 - Located MBean 'org.apache.james:type=component,name=reindexerbean': registering with JMX server as MBean [org.apache.james:type=component,name=reindexerbean]
jvm 1 | 24-Nis-2022 15:52:37.035 INFO [WrapperSimpleAppMain] org.springframework.jmx.export.MBeanExporter.registerBeanInstance:672 - Located MBean 'org.apache.james:type=component,name=sievemanagerbean': registering with JMX server as MBean [org.apache.james:type=component,name=sievemanagerbean]
jvm 1 | 24-Nis-2022 15:52:37.040 INFO [WrapperSimpleAppMain] org.apache.james.app.spring.JamesAppSpringMain.main:46 - Apache James Server is successfully started in 6214 milliseconds.
It says server started, there are so many error messages that i am doubtfull.\
Anyway, I tried to add a user as below; but i did not worked again
D:\james\bin>james-cli.bat adduser user#localhost myPass
24-Nis-2022 15:59:13.194 ERROR [main] org.apache.james.cli.ServerCmd.main:101 - Error while playing command
java.lang.Exception: Unexpected exception
at org.apache.james.user.lib.UsersRepositoryManagement.addUser(UsersRepositoryManagement.java:57) ~[james-server-data-library-3.7.0.jar:3.7.0]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:72) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:262) ~[?:?]
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) ~[?:?]
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) ~[?:?]
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) ~[?:?]
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) ~[?:?]
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) ~[?:?]
at javax.management.StandardMBean.invoke(StandardMBean.java:405) ~[?:?]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:814) ~[?:?]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802) ~[?:?]
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1472) ~[?:?]
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1310) ~[?:?]
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1405) ~[?:?]
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360) ~[?:?]
at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[?:?]
at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:712) ~[?:?]
at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[?:?]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) ~[?:?]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) ~[?:?]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Error class java.lang.Exception while executing command:Unexpected exception
usage: java org.apache.james.cli.ServerCmd --host <arg> <command>
-h,--host <arg> node hostname or ip address
-p,--port <arg> remote jmx agent port number
AddUser <username> <password>
RemoveUser <username>
ListUsers
AddDomain <domainName>
RemoveDomain <domainName>
ContainsDomain <domainName>
ListDomains
ListMappings
ListUserDomainMappings <user> <domain>
AddAddressMapping <fromUser> <fromDomain> <toAddress>
RemoveAddressMapping <fromUser> <fromDomain> <toAddress>
AddRegexMapping <user> <domain> <regex>
RemoveRegexMapping <user> <domain> <regex>
SetPassword <username> <password>
CopyMailbox <srcBean> <dstBean>
DeleteUserMailboxes <user>
CreateMailbox <namespace> <user> <name>
ListUserMailboxes <user>
DeleteMailbox <namespace> <user> <name>
ImportEml <namespace> <user> <name> <path>
GetStorageQuota <quotaroot>
GetMessageCountQuota <quotaroot>
GetQuotaroot <namespace> <user> <name>
GetMaxStorageQuota <quotaroot>
GetMaxMessageCountQuota <quotaroot>
SetMaxStorageQuota <quotaroot> <maxMessageCount>
SetMaxMessageCountQuota <quotaroot> <maxStorage>
SetGlobalMaxStorageQuota <maxStorage>
SetGlobalMaxMessageCountQuota <maxMessageCount>
GetGlobalMaxStorageQuota
GetGlobalMaxMessageCountQuota
ReindexMailbox <namespace> <user> <name>
ReindexAll
GetSieveQuota
SetSieveQuota <quota>
RemoveSieveQuota
GetSieveUserQuota <username>
SetSieveUserQuota <username> <quota>
RemoveSieveUserQuota <username>
AddActiveSieveScript <username> <scriptname> <path>
Could you put me in the right track.
Use
cd james-server-spring-app-3.7.3\bin
run.bat
If the windows firewall pops up and asks to allow the opening of the port, please allow the opening of the relevant port for Apache James Mail Server to use.
Do not use
james console
run.bat - log
C:\Users\IEUser\Downloads\james-server-spring-app-3.7.3\bin>run.bat
24-Jan-2023 04:55:15.525 INFO [main] org.springframework.context.support.AbstractApplicationContext.prepareRefresh:583 - Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext#7c098bb3: startup date [Tue Jan 24 04:55:15 PST 2023]; root of context hierarchy
24-Jan-2023 04:55:15.610 INFO [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions:317 - Loading XML bean definitions from class path resource [META-INF/org/apache/james/spring-server.xml]
...
24-Jan-2023 04:55:25.995 INFO [main] org.apache.activemq.transport.TransportServerThreadSupport.doStart:69 - Listening for connections at: tcp://127.0.0.1:50043
24-Jan-2023 04:55:25.995 INFO [main] org.apache.activemq.broker.TransportConnector.start:267 - Connector tcp://127.0.0.1:50043 started
24-Jan-2023 04:55:26.010 INFO [main] org.apache.activemq.broker.BrokerService.doStartBroker:759 - Apache ActiveMQ 5.17.2 (james, broker) started
...
24-Jan-2023 04:55:27.678 INFO [main] org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer.configure:199 - SMTP Service bound to: 0.0.0.0:25
...
24-Jan-2023 04:55:27.992 INFO [main] org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer.configure:199 - POP3 Service bound to: 0.0.0.0:110
...
24-Jan-2023 04:55:28.239 INFO [main] org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer.configure:199 - IMAP Service bound to: 0.0.0.0:143
...
24-Jan-2023 04:55:28.378 INFO [main] org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry:217 - Looking for RMI registry at port '9999', using custom socket factory
...
24-Jan-2023 04:55:29.997 INFO [main] org.apache.james.app.spring.JamesAppSpringMain.main:46 - Apache James Server is successfully started in 14534 milliseconds.
james-cli.bat - log
C:\Users\IEUser\Downloads\james-server-spring-app-3.7.3\bin>james-cli.bat adduser user#localhost myPass
AddUser command executed sucessfully in 573 ms.
My Env:
Windows 10,
OpenJDK11U-jdk_x64_windows_hotspot_11.0.18_10.msi
james-server-spring-app-3.7.3-app.zip
JDK install
(1) Remove Environment Variavle: JAVA_HOME, And Remove JDK Path from Environment Variavle: PATH
(2) install adoptium Open JDK 11
(2-1) Download JDK msi file - https://adoptium.net/temurin/releases/
Operating System: Windows
Architecture: x64
Package Type: JDK
Version: 11
install Type: .msi
(2-2) click OpenJDK11U-jdk_x64_windows_hotspot_11.0.18_10.msi
(2-3) GUI: Welcome to ..., Click Next
(2-4) GUI: Custom Setup,
(2-4-1) Set JAVA_HOME variale, drop down, select Entire feacture will be installed on local hard drive
(2-4-2) JavaSoft(Oracle) registry keys, drop down, select Entire feacture will be installed on local hard drive
(2-4-3) Click Next
(2-5) GUI: Ready to install ..., click Install
(2-6) Windows: User Account Control, Do you want to allow..., clock Yes
(2-7) GUI: Completed the Eclipse ..., click Finish

Problems when moving from the jetty server to the tomcat server

I'm really stuck with a problem
I have built an Axis 2 client running against an API using a .WSDL file. I have used a local jetty server when I have developed, but I need to move it over to a local tomcat server. When I moved my .war file to the local Tomcat, I get the following error. Can someone please give me some advice so I'm going in the right direction
SLL debug in tomcat:
http-nio-8080-exec-1, WRITE: TLSv1.2 Handshake, length = 189
http-nio-8080-exec-1, handling exception: java.net.SocketException: Connection reset
http-nio-8080-exec-1, SEND TLSv1.2 ALERT: fatal, description = unexpected_message
http-nio-8080-exec-1, WRITE: TLSv1.2 Alert, length = 2
http-nio-8080-exec-1, Exception sending alert: java.net.SocketException: Connection reset by peer: socket write error
http-nio-8080-exec-1, called closeSocket()
http-nio-8080-exec-1, called close()
http-nio-8080-exec-1, called closeInternal(true)
A
INFO | jvm 1 | 2016/12/21 13:28:59.193 | Unable to sendViaPost to url[https://someurl.com/Service.svc]
INFO | jvm 1 | 2016/12/21 13:28:59.194 | org.apache.axis2.AxisFault: Connection reset
INFO | jvm 1 | 2016/12/21 13:28:59.196 | at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
INFO | jvm 1 | 2016/12/21 13:28:59.197 | at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:99)
INFO | jvm 1 | 2016/12/21 13:28:59.198 | at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
INFO | jvm 1 | 2016/12/21 13:28:59.199 | at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
INFO | jvm 1 | 2016/12/21 13:28:59.201 | at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
INFO | jvm 1 | 2016/12/21 13:28:59.204 | at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
INFO | jvm 1 | 2016/12/21 13:28:59.205 | at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
INFO | jvm 1 | 2016/12/21 13:28:59.206 | at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
INFO | jvm 1 | 2016/12/21 13:28:59.207 | at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:900)
INFO | jvm 1 | 2016/12/21 13:28:59.209 | at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:212)
INFO | jvm 1 | 2016/12/21 13:28:59.213 | at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
INFO | jvm 1 | 2016/12/21 13:28:59.215 | at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
INFO | jvm 1 | 2016/12/21 13:28:59.218 | at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
INFO | jvm 1 | 2016/12/21 13:28:59.220 | at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
INFO | jvm 1 | 2016/12/21 13:28:59.222 | at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
INFO | jvm 1 | 2016/12/21 13:28:59.224 | at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
INFO | jvm 1 | 2016/12/21 13:28:59.227 | at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
INFO | jvm 1 | 2016/12/21 13:28:59.229 | at se.docpub.documentfolderservice.DocumentFolderServiceStub.loadFolder(DocumentFolderServiceStub.java:769)
INFO | jvm 1 | 2016/12/21 13:28:59.231 | at se.soleilit.document_api.resources.DocumentResource.getPublishedFolder(DocumentResource.java:96)
INFO | jvm 1 | 2016/12/21 13:28:59.233 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2016/12/21 13:28:59.235 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:28:59.236 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:28:59.237 | at java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:28:59.239 | at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
INFO | jvm 1 | 2016/12/21 13:28:59.246 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
INFO | jvm 1 | 2016/12/21 13:28:59.250 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
INFO | jvm 1 | 2016/12/21 13:28:59.255 | at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
INFO | jvm 1 | 2016/12/21 13:28:59.265 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
INFO | jvm 1 | 2016/12/21 13:28:59.270 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
INFO | jvm 1 | 2016/12/21 13:28:59.279 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
INFO | jvm 1 | 2016/12/21 13:28:59.283 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
INFO | jvm 1 | 2016/12/21 13:28:59.290 | at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
INFO | jvm 1 | 2016/12/21 13:28:59.298 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
INFO | jvm 1 | 2016/12/21 13:28:59.302 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
INFO | jvm 1 | 2016/12/21 13:28:59.304 | at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
INFO | jvm 1 | 2016/12/21 13:28:59.306 | at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
INFO | jvm 1 | 2016/12/21 13:28:59.308 | at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
INFO | jvm 1 | 2016/12/21 13:28:59.314 | at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
INFO | jvm 1 | 2016/12/21 13:28:59.316 | at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
INFO | jvm 1 | 2016/12/21 13:28:59.324 | at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
INFO | jvm 1 | 2016/12/21 13:28:59.330 | at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
INFO | jvm 1 | 2016/12/21 13:28:59.333 | at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
INFO | jvm 1 | 2016/12/21 13:28:59.336 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
INFO | jvm 1 | 2016/12/21 13:28:59.339 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
INFO | jvm 1 | 2016/12/21 13:28:59.345 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
INFO | jvm 1 | 2016/12/21 13:28:59.348 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
INFO | jvm 1 | 2016/12/21 13:28:59.352 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
INFO | jvm 1 | 2016/12/21 13:28:59.354 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
INFO | jvm 1 | 2016/12/21 13:28:59.356 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
INFO | jvm 1 | 2016/12/21 13:28:59.357 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
INFO | jvm 1 | 2016/12/21 13:28:59.363 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
INFO | jvm 1 | 2016/12/21 13:28:59.365 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
INFO | jvm 1 | 2016/12/21 13:28:59.367 | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
INFO | jvm 1 | 2016/12/21 13:28:59.369 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
INFO | jvm 1 | 2016/12/21 13:28:59.371 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
INFO | jvm 1 | 2016/12/21 13:28:59.373 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
INFO | jvm 1 | 2016/12/21 13:28:59.375 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
INFO | jvm 1 | 2016/12/21 13:28:59.376 | at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
INFO | jvm 1 | 2016/12/21 13:29:00.224 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
INFO | jvm 1 | 2016/12/21 13:29:00.532 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
INFO | jvm 1 | 2016/12/21 13:29:00.534 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
INFO | jvm 1 | 2016/12/21 13:29:00.535 | at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.537 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.539 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
INFO | jvm 1 | 2016/12/21 13:29:00.541 | at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.542 | Caused by: java.net.SocketException: Connection reset
INFO | jvm 1 | 2016/12/21 13:29:00.543 | at java.net.SocketInputStream.read(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.555 | at java.net.SocketInputStream.read(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.558 | at sun.security.ssl.InputRecord.readFully(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.560 | at sun.security.ssl.InputRecord.readV3Record(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.573 | at sun.security.ssl.InputRecord.read(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.590 | at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.593 | at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.618 | at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.621 | at sun.security.ssl.AppOutputStream.write(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.656 | at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.659 | at java.io.BufferedOutputStream.flush(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.726 | at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:95)
INFO | jvm 1 | 2016/12/21 13:29:00.738 | ... 63 more

Websphere MQ via JMS: NoClassDefFoundError

I'm trying to make a simple JMS client application for Websphere MQ 7.5
I already have ".bindings" file with connection factory and destination, which I'm trying to connecto to.
This is my simple Java code, that I'm trying to run on mac:
package com.company;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.naming.Context;
import javax.naming.directory.InitialDirContext;
import java.util.Hashtable;
public class Main {
public static final String cfLookup = "TEST12";
public static final String icf = "com.sun.jndi.fscontext.RefFSContextFactory";
static String url = "file:///tmp/JNDI";
public static void main(String[] args) {
InitialDirContext ctx = null;
Destination myDest = null;
ConnectionFactory connFactory = null;
Hashtable environment = new Hashtable();
try {
environment.put(Context.INITIAL_CONTEXT_FACTORY, icf);
environment.put(Context.PROVIDER_URL, url);
ctx = new InitialDirContext( environment );
connFactory = (ConnectionFactory)ctx.lookup( cfLookup );
} catch (Exception e) {
e.printStackTrace();
}
}
}
And this is the exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.setProviderFactory(JmsConnectionFactoryImpl.java:168)
at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:293)
at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.company.Main.main(Main.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
It's pretty obvious, that some other libraries are required, but none of those JAR file I got copying from Websphere MQ client installation seem to work. And also it feels kinda strange that some provider specific class is needed to make a query against JNDI.
I already read a lot of topics at IBM and mqseries, but nothing helps. Any assistance would by higly appreciated.
Also with every run there is also a newly generated FDC file with more detailed information
----------------------------------START FFST------------------------------------
/Users/***/IdeaProjects/JmsSample/FFDC/JMSCC0001.FDC PID:640
JMS Common Client First Failure Symptom Report
Product :- IBM WebSphere MQ classes for JMS
Date/Time :- Sat Feb 06 16:56:23 MSK 2016
System time :- 1454766983855
Operating System :- Mac OS X
UserID :- ***
Java Vendor :- Oracle Corporation
Java Version :- 25.72-b15
Source Class :- JmsFactoryFactory
Source Method :- getIntance(int)
ProbeID :- XI001005
Thread :- name=main priority=5 group=main ccl=sun.misc.Launcher$AppClassLoader#372f7a8d
Data
----
| connectionTypeName :- com.ibm.msg.client.wmq
| exception :- ExceptionDepth is 4
| exception :-
| | Cause:1 :- java.lang.reflect.InvocationTargetException
| | Cause:2 :- java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
| | Cause:3 :- java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
| | Message:2 :- com/ibm/disthub2/impl/client/SessionConfig
| | Message:3 :- com.ibm.disthub2.impl.client.SessionConfig
| | StackTrace:1 :- java.lang.reflect.InvocationTargetException
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| | at java.lang.reflect.Method.invoke(Method.java:498)
| | at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:182)
| | at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
| | at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
| | at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
| | at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
| | at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
| | at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
| | at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
| | at javax.naming.InitialContext.lookup(InitialContext.java:417)
| | at com.company.Main.main(Main.java:31)
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| | at java.lang.reflect.Method.invoke(Method.java:498)
| | at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
| | Caused by: java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
| | at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
| | at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
| | ... 19 more
| | Caused by: java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
| | at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
| | at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
| | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
| | at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
| | ... 24 more
| |
| | StackTrace:2 :- java.lang.NoClassDefFoundError: com/ibm/disthub2/impl/client/SessionConfig
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
| | at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
| | at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| | at java.lang.reflect.Method.invoke(Method.java:498)
| | at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:182)
| | at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
| | at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
| | at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
| | at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
| | at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
| | at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
| | at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
| | at javax.naming.InitialContext.lookup(InitialContext.java:417)
| | at com.company.Main.main(Main.java:31)
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| | at java.lang.reflect.Method.invoke(Method.java:498)
| | at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
| | Caused by: java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
| | at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
| | at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
| | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
| | at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
| | ... 24 more
| |
| | StackTrace:3 :- java.lang.ClassNotFoundException: com.ibm.disthub2.impl.client.SessionConfig
| | at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
| | at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
| | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
| | at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.setupDistHubTracing(WMQFactoryFactory.java:335)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.<init>(WMQFactoryFactory.java:305)
| | at com.ibm.msg.client.wmq.factories.WMQFactoryFactory.getInstance(WMQFactoryFactory.java:186)
| | at com.ibm.msg.client.wmq.factories.WMQComponent.getFactoryInstance(WMQComponent.java:140)
| | at com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl.getInstance(JmsFactoryFactoryImpl.java:157)
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| | at java.lang.reflect.Method.invoke(Method.java:498)
| | at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:182)
| | at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
| | at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
| | at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
| | at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
| | at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
| | at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
| | at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
| | at javax.naming.InitialContext.lookup(InitialContext.java:417)
| | at com.company.Main.main(Main.java:31)
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| | at java.lang.reflect.Method.invoke(Method.java:498)
| | at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
| |
Version information
-------------------
IBM WebSphere MQ JMS Provider
7.5.0.3
p750-003-140123
Production
Common Services for Java Platform, Standard Edition
7.5.0.3
p750-003-140123
Production
Java Message Service Client
7.5.0.3
p750-003-140123
Production
WebSphere MQ classes for Java Message Service
7.5.0.3
p750-003-140123
Production
Stack trace
-----------
Stack trace to show the location of the FFST call
| FFST Location :- java.lang.Exception
| at com.ibm.msg.client.commonservices.trace.Trace.getCurrentPosition(Trace.java:1959)
| at com.ibm.msg.client.commonservices.trace.Trace.createFFSTString(Trace.java:1898)
| at com.ibm.msg.client.commonservices.trace.Trace.ffstInternal(Trace.java:1787)
| at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1660)
| at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:214)
| at com.ibm.mq.jms.MQConnectionFactory.initialiseMQConnectionFactory(MQConnectionFactory.java:3314)
| at com.ibm.mq.jms.MQConnectionFactory.<init>(MQConnectionFactory.java:283)
| at com.ibm.mq.jms.MQQueueConnectionFactory.<init>(MQQueueConnectionFactory.java:81)
| at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:77)
| at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
| at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
| at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
| at javax.naming.InitialContext.lookup(InitialContext.java:417)
| at com.company.Main.main(Main.java:31)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| at java.lang.reflect.Method.invoke(Method.java:498)
| at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
|
Property Store Contents
-----------------------
All currently set properties
| awt.toolkit :- sun.lwawt.macosx.LWCToolkit
| file.encoding :- UTF-8
| file.encoding.pkg :- sun.io
| file.separator :- /
| ftp.nonProxyHosts :- local|*.local|169.254/16|*.169.254/16
| gopherProxySet :- false
| http.nonProxyHosts :- local|*.local|169.254/16|*.169.254/16
| idea.launcher.bin.path :- /Applications/IntelliJ IDEA 15 CE.app/Contents/bin
| idea.launcher.port :- 7533
| java.awt.graphicsenv :- sun.awt.CGraphicsEnvironment
| java.awt.printerjob :- sun.lwawt.macosx.CPrinterJob
| java.class.path :- /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/lib/tools.jar:/Users/vladimirpopov/IdeaProjects/JmsSample/out/production/JmsSample:/Users/vladimirpopov/IdeaProjects/JmsSample/com.ibm.mq.jar:/Users/vladimirpopov/IdeaProjects/JmsSample/com.ibm.mqjms.jar:/Users/vladimirpopov/Downloads/jar/jms.jar:/Users/vladimirpopov/Downloads/jar/jndi.jar:/Users/vladimirpopov/Downloads/jar/fscontext.jar:/Users/vladimirpopov/Downloads/jar/com.ibm.mq.commonservices.jar:/Users/vladimirpopov/Downloads/jar/com.ibm.mq.defaultconfig.jar:/Users/vladimirpopov/Downloads/jar/providerutil.jar:/Applications/IntelliJ IDEA 15 CE.app/Contents/lib/idea_rt.jar
| java.class.version :- 52.0
| java.endorsed.dirs :- /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/endorsed
| java.ext.dirs :- /Users/vladimirpopov/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
| java.home :- /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre
| java.io.tmpdir :- /var/folders/v0/vk3bz2wn79q5_9qggqqf_ynh0000gn/T/
| java.library.path :- /Users/vladimirpopov/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
| java.runtime.name :- Java(TM) SE Runtime Environment
| java.runtime.version :- 1.8.0_72-b15
| java.specification.name :- Java Platform API Specification
| java.specification.vendor :- Oracle Corporation
| java.specification.version :- 1.8
| java.vendor :- Oracle Corporation
| java.vendor.url :- http://java.oracle.com/
| java.vendor.url.bug :- http://bugreport.sun.com/bugreport/
| java.version :- 1.8.0_72
| java.vm.info :- mixed mode
| java.vm.name :- Java HotSpot(TM) 64-Bit Server VM
| java.vm.specification.name :- Java Virtual Machine Specification
| java.vm.specification.vendor :- Oracle Corporation
| java.vm.specification.version :- 1.8
| java.vm.vendor :- Oracle Corporation
| java.vm.version :- 25.72-b15
| line.separator :-
|
| os.arch :- x86_64
| os.name :- Mac OS X
| os.version :- 10.10.5
| path.separator :- :
| socksNonProxyHosts :- local|*.local|169.254/16|*.169.254/16
| sun.arch.data.model :- 64
| sun.boot.class.path :- /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/classes
| sun.boot.library.path :- /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib
| sun.cpu.endian :- little
| sun.cpu.isalist :-
| sun.io.unicode.encoding :- UnicodeBig
| sun.java.command :- com.intellij.rt.execution.application.AppMain com.company.Main
| sun.java.launcher :- SUN_STANDARD
| sun.jnu.encoding :- UTF-8
| sun.management.compiler :- HotSpot 64-Bit Tiered Compilers
| sun.os.patch.level :- unknown
| user.country :- US
| user.dir :- /Users/vladimirpopov/IdeaProjects/JmsSample
| user.home :- /Users/vladimirpopov
| user.language :- en
| user.name :- vladimirpopov
| user.timezone :-
WorkQueueMananger Contents
--------------------------
| Current ThreadPool size :- 0
| Maintain ThreadPool size :- false
| Maximum ThreadPool size :- -1
| ThreadPool inactive timeout :- 0
Runtime properties
------------------
| Available processors :- 4
| Free memory in bytes (now) :- 107069912
| Max memory in bytes :- 1908932608
| Total memory in bytes (now) :- 128974848
Component Manager Contents
--------------------------
Common Services Components:
| CMVC :- p750-003-140123
| Class Name :- class com.ibm.msg.client.commonservices.j2se.J2SEComponent
| Component Name :- com.ibm.msg.client.commonservices.j2se
| Component Title :- Common Services for Java Platform, Standard Edition
| Factory Class :- class com.ibm.msg.client.commonservices.j2se.CommonServicesImplementation
| Version :- 7.5.0.3
| inPreferenceTo[0] :- com.ibm.msg.client.commonservices.j2me
Messaging Provider Components:
| CMVC :- p750-003-140123
| Class Name :- class com.ibm.msg.client.wmq.factories.WMQComponent
| Component Name :- com.ibm.msg.client.wmq
| Component Title :- IBM WebSphere MQ JMS Provider
| Factory Class :- class com.ibm.msg.client.wmq.factories.WMQFactoryFactory
| Version :- 7.5.0.3
You do realize that you can look inside the JAR files? The MQ Java JAR file with that class is 'dhbcore.jar'.
Instead of selectively copying then using certain MQ JAR files (which is not supported by IBM), why don't you follow the supported path IBM has laid out?
Add dhbcore.jar in class path and you should be good.
I'm working with WAS8 but I believe that the answer will be similar.
You'll have to reference the libs located in the ${was8Path}/installedConnectors/wmq.jmsra.rar/ path.
I had a similar exception **Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/msg/client/commonservices/trace/Trace** and I solved it by referencing the ${was8Path}/installedConnectors/wmq.jmsra.rar/com.ibm.msg.client.commonservices.jar library to the project.

Failed to load type

I'm using Netbeans IDE.
INFO | jvm 1 | 2015/12/29 23:27:18 | Java Runtime: Oracle Corporation 1.7.0_51 C:\Program Files (x86)\Java\jre7
INFO | jvm 1 | 2015/12/29 23:27:18 | Heap sizes: current=15872k free=12594k max=506816k.
INFO | jvm 1 | 2015/12/29 23:27:18 | JVM args: -Dactivemq.home=./. -Dactivemq.base=./. -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.keyStore=././conf/broker.ks -Djavax.net.ssl.trustStore=././conf/broker.ts -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRunner=true -DJava.util.logging.config.file=logging.properties -Xmx512m -DJava.library.path=././bin/win32 -Dwrapper.key=nnnVAsNERmehemBP -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=632 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1.
INFO | jvm 1 | 2015/12/29 23:27:18 | ACTIVEMQ_HOME:..
INFO | jvm 1 | 2015/12/29 23:27:18 | ACTIVEMQ_BASE:..
INFO | jvm 1 | 2015/12/29 23:27:18 | Loading message broker from: xbean:activemq.xml.
INFO | jvm 1 | 2015/12/29 23:27:19 | INFO CamelNamespaceHandler - camel-osgi.jar not detected in classpath.
INFO | jvm 1 | 2015/12/29 23:27:19 | ERROR: Java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: processing.XslProcessor. Reason: Java.lang.ClassNotFoundException: processing.XslProcessor; nested exception is Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | Java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: processing.XslProcessor. Reason: Java.lang.ClassNotFoundException: processing.XslProcessor; nested exception is Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:98)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:57)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.ShellCommand.runTask (ShellCommand.java:129)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:57)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.ShellCommand.main (ShellCommand.java:79)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.reflect.Method.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.Main.runTaskClass (Main.java:251)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.Main.main (Main.java:107)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.reflect.Method.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run (WrapperSimpleApp.java:240)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.Thread.run (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: processing.XslProcessor. Reason: Java.lang.ClassNotFoundException: processing.XslProcessor; nested exception is Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo (XBeanQNameHelper.java:75)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.coerceNamespaceAwarePropertyValues (XBeanQNameHelper.java:54)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanBeanDefinitionParserDelegate.parseBeanDefinitionElement (XBeanBeanDefinitionParserDelegate.java:59)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement (BeanDefinitionParserDelegate.java:389)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement (BeanDefinitionParserDelegate.java:358)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.processBeanDefinition (XBeanBeanDefinitionDocumentReader.java:174)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseDefaultElement (XBeanBeanDefinitionDocumentReader.java:101)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions (XBeanBeanDefinitionDocumentReader.java:81)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions (DefaultBeanDefinitionDocumentReader.java:92)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions (XmlBeanDefinitionReader.java:507)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions (XBeanXmlBeanDefinitionReader.java:79)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:398)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:342)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:310)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions (ResourceXmlApplicationContext.java:111)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions (ResourceXmlApplicationContext.java:104)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory (AbstractRefreshableApplicationContext.java:123)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory (AbstractApplicationContext.java:422)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:352)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext (XBeanBrokerFactory.java:96)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker (XBeanBrokerFactory.java:52)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.broker.BrokerFactory.createBroker (BrokerFactory.java:71)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.broker.BrokerFactory.createBroker (BrokerFactory.java:54)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.StartCommand.startBroker (StartCommand.java:115)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:74)
INFO | jvm 1 | 2015/12/29 23:27:19 |. 16 more.
INFO | jvm 1 | 2015/12/29 23:27:19 | Caused by: Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.net.URLClassLoader$1.run (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.net.URLClassLoader$1.run (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.security.AccessController.doPrivileged (Native Method)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.net.URLClassLoader.findClass (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.ClassLoader.loadClass (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.ClassLoader.loadClass (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.loadClass (XBeanQNameHelper.java:107)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo (XBeanQNameHelper.java:72)
INFO | jvm 1 | 2015/12/29 23:27:19 |. 42 more.
INFO | jvm 1 | 2015/12/29 23:27:19 | ERROR: Java.lang.Exception: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: processing.XslProcessor. Reason: Java.lang.ClassNotFoundException: processing.XslProcessor; nested exception is Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | Java.lang.Exception: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: processing.XslProcessor. Reason: Java.lang.ClassNotFoundException: processing.XslProcessor; nested exception is Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:99)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:57)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.ShellCommand.runTask (ShellCommand.java:129)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:57)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.ShellCommand.main (ShellCommand.java:79)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.reflect.Method.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.Main.runTaskClass (Main.java:251)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.Main.main (Main.java:107)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.reflect.Method.invoke (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run (WrapperSimpleApp.java:240)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.Thread.run (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: processing.XslProcessor. Reason: Java.lang.ClassNotFoundException: processing.XslProcessor; nested exception is Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo (XBeanQNameHelper.java:75)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.coerceNamespaceAwarePropertyValues (XBeanQNameHelper.java:54)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanBeanDefinitionParserDelegate.parseBeanDefinitionElement (XBeanBeanDefinitionParserDelegate.java:59)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement (BeanDefinitionParserDelegate.java:389)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement (BeanDefinitionParserDelegate.java:358)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.processBeanDefinition (XBeanBeanDefinitionDocumentReader.java:174)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseDefaultElement (XBeanBeanDefinitionDocumentReader.java:101)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions (XBeanBeanDefinitionDocumentReader.java:81)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions (DefaultBeanDefinitionDocumentReader.java:92)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions (XmlBeanDefinitionReader.java:507)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions (XBeanXmlBeanDefinitionReader.java:79)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:398)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:342)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:310)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions (ResourceXmlApplicationContext.java:111)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions (ResourceXmlApplicationContext.java:104)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory (AbstractRefreshableApplicationContext.java:123)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory (AbstractApplicationContext.java:422)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:352)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext (XBeanBrokerFactory.java:96)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker (XBeanBrokerFactory.java:52)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.broker.BrokerFactory.createBroker (BrokerFactory.java:71)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.broker.BrokerFactory.createBroker (BrokerFactory.java:54)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.StartCommand.startBroker (StartCommand.java:115)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:74)
INFO | jvm 1 | 2015/12/29 23:27:19 |. 16 more.
INFO | jvm 1 | 2015/12/29 23:27:19 | Caused by: Java.lang.ClassNotFoundException: processing.XslProcessor.
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.net.URLClassLoader$1.run (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.net.URLClassLoader$1.run (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.security.AccessController.doPrivileged (Native Method)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.net.URLClassLoader.findClass (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.ClassLoader.loadClass (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at Java.lang.ClassLoader.loadClass (Unknown Source)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.loadClass (XBeanQNameHelper.java:107)
INFO | jvm 1 | 2015/12/29 23:27:19 | at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo (XBeanQNameHelper.java:72)
INFO | jvm 1 | 2015/12/29 23:27:19 |. 42 more.
Activemq.xml:
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data">
<plugins>
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" read="admins,users" write="admins,users" admin="admins,users"/>
<authorizationEntry topic="ActiveMQ.Advisory.>" read="guests,users" write="guests,users" admin="guests,users"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="test" password="test" groups="users"/>
<authenticationUser username="system" password="manager" groups="admins,users"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" memoryLimit="5mb"/>
<policyEntry topic=">" memoryLimit="5mb">
<dispatchPolicy>
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<subscriptionRecoveryPolicy>
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<networkConnectors>
<!-- by default just auto discover the other brokers -->
<networkConnector name="default-nc" uri="multicast://default" userName="system" password="manager"/>
<networkConnector name="localhost" uri="static://(tcp://127.0.0.1:61616)" userName="system" password="manager"/>
</networkConnectors>
<persistenceAdapter>
<amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb"/>
</persistenceAdapter>
<sslContext>
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" trustStorePassword="password"/>
</sslContext>
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616" discoveryUri="multicast://default" />
<transportConnector name="ssl" uri="ssl://0.0.0.0:61617" />
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613" />
<transportConnector name="xmpp" uri="xmpp://0.0.0.0:61222" />
</transportConnectors>
</broker>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<package>processing</package>
<route>
<from uri="activemq:test"/>
<multicast>
<to uri="activemq:toStdOut"/>
<to uri="activemq:toStdOut2"/>
<to uri="activemq:routeError"/>
</multicast>
</route>
<!-- Contr1 inbound route -->
<route>
<from uri="activemq:contr1In"/>
<to uri="activemq:contr1InTransform"/>
<bean ref="contr1InProcessor" method="process"/>
<multicast>
<to uri="activemq:oneCIn"/>
</multicast>
</route>
<!-- Contr1 outbound route -->
<route>
<from uri="activemq:contr1OutTransform"/>
<bean ref="contr1OutProcessor" method="process"/>
<to uri="activemq:contr1Out"/>
</route>
<!-- OneC outbound route -->
<route>
<from uri="activemq:oneCOut"/>
<choice>
<when>
<xpath>//contr-id = '1'</xpath>
<to uri="activemq:contr1OutTransform"/>
</when>
<otherwise>
<to uri="activemq:routeError"/>
</otherwise>
</choice>
</route>
</camelContext>
<bean id="contr1InProcessor" class="processing.XslProcessor">
<property name="xslName" value="PrepareRequest.xsl"/>
<property name="contrId" value="1"/>
</bean>
<bean id="contr1OutProcessor" class="processing.XslProcessor">
<property name="xslName" value="PrepareResponse.xsl"/>
<property name="contrId" value="1"/>
</bean>
<bean id="errorConsumerBean" class="processing.ErrorConsumer" lazy-init="false">
<property name="destinationDir" value="D:\1c-jms\1c-jms\errors"/>
</bean>
<bean id="testBean" class="processing.Test" lazy-init="false"/>
<!-- configure the camel activemq component to use the current broker -->
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
<property name="userName" value="system"/>
<property name="password" value="manager"/>
</bean>
</property>
</bean>
<!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic -->
<!--
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost" username="${activemq.username}" password="${activemq.password}"/>
-->
<!-- An embedded servlet engine for serving up the Admin console -->
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
<connectors>
<nioConnector port="8161"/>
</connectors>
<handlers>
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
<webAppContext contextPath="/camel" resourceBase="${activemq.base}/webapps/camel" logUrlOnStart="true"/>
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
</handlers>
</jetty>
Class:
public class XslProcessor implements Processor
{
private String xslName = null;
private String contrId = null;
#EndpointInject(uri="activemq:error")
private ProducerTemplate errorProducer = null;
public ProducerTemplate getErrorProducer()
{
return errorProducer;
}
public void setErrorProducer(ProducerTemplate errorProducer)
{
this.errorProducer = errorProducer;
}
public static class MyErrorListener implements ErrorListener
{
private Throwable lastException = null;
public Throwable getLastException()
{
return lastException;
}
public void setLastException(Throwable lastException)
{
this.lastException = lastException;
}
public void error(TransformerException exception) throws TransformerException
{
lastException = exception;
}
public void fatalError(TransformerException exception) throws TransformerException
{
lastException = exception;
}
public void warning(TransformerException exception) throws TransformerException
{
lastException = exception;
}
}
public String getXslName()
{
return xslName;
}
public void setXslName(String xslName)
{
this.xslName = xslName;
}
public String getContrId()
{
return contrId;
}
public void setContrId(String contrId)
{
this.contrId = contrId;
}
public void process(Exchange _exchange) throws Exception
{
byte[] buf = _exchange.getIn().getBody(byte[].class);
ByteArrayInputStream xmlStream = new ByteArrayInputStream(buf);
try
{
StreamSource xmlSource = new StreamSource(xmlStream);
InputStream xslStream = this.getClass().getResourceAsStream(xslName);
MyErrorListener errorListener = new MyErrorListener();
try
{
StreamSource xslSource = new StreamSource(xslStream);
TransformerFactory factory = TransformerFactory.newInstance();
factory.setErrorListener(errorListener);
Transformer t = factory.newTransformer(xslSource);
ByteArrayOutputStream resultStream = new ByteArrayOutputStream();
try
{
StreamResult result = new StreamResult(resultStream);
t.setParameter("contrId", contrId);
t.transform(xmlSource, result);
if (errorListener.lastException != null)
{
throw new Exception("Exception in xslt: ",errorListener.lastException);
}
resultStream.flush();
_exchange.getOut().setBody(resultStream.toByteArray(), byte[].class);
}
finally
{
resultStream.close();
}
}
finally
{
xslStream.close();
}
}
catch (Throwable _t)
{
errorProducer.sendBody(buf);
}
finally
{
xmlStream.close();
}
}
}

Categories