NoClassDefFoundError in OSGi although it is exported and imported - java

I tried to create a basic virtual reality IDE based on Karaf.
I have 3 maven-projects:
VRServer who connect to a native-component for rendering.
VR Component Toolkit for VR-HMI-Widgets (Having a VRFrame who extends from VRComponent) as a Multi-Module-Maven-Project.
The VR IDE project read/write files and execute lowlevel commands.
I installed all of them into Karaf:
karaf#root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID | State | Lvl | Version | Name
----+--------+-----+--------------------+---------------------------------------------------------------------------
31 | Active | 80 | 4.3.0 | Apache Karaf :: OSGi Services :: Event
54 | Active | 80 | 1.3.2 | Apache Aries SPI Fly Dynamic Weaving Bundle
55 | Active | 80 | 9.0.0 | org.objectweb.asm
56 | Active | 80 | 9.0.0 | org.objectweb.asm.commons
57 | Active | 80 | 9.0.0 | org.objectweb.asm.tree
58 | Active | 80 | 9.0.0 | org.objectweb.asm.tree.analysis
59 | Active | 80 | 9.0.0 | org.objectweb.asm.util
60 | Active | 80 | 2.0.17 | OpenWebBeans Core
61 | Active | 80 | 2.0.17 | SPI definition
62 | Active | 80 | 1.1.3 | Apache Aries CDI - CDI Component Runtime (CCR)
63 | Active | 80 | 1.1.3 | Apache Aries CDI - SPI classes for Portable Extensions
64 | Active | 80 | 1.1.3 | Apache Aries CDI - Container using Apache OpenWebBeans
65 | Active | 80 | 1.1.3 | Apache Aries CDI - SPI
66 | Active | 80 | 1.0.12 | Apache Felix Converter
67 | Active | 80 | 1.2.0 | Apache Geronimo JSR-330 Spec 1.0
68 | Active | 80 | 1.1.0 | Apache Geronimo Expression Language Spec 2.2
69 | Active | 80 | 1.2.0 | Apache Geronimo Interceptor Spec 1.2
70 | Active | 80 | 1.2.0 | Apache Geronimo JCDI Spec 2.0
71 | Active | 80 | 1.3.0.3 | Apache ServiceMix :: Specs :: Annotation API 1.3
72 | Active | 80 | 4.17.0 | Apache XBean :: ASM shaded (repackaged)
73 | Active | 80 | 4.17.0 | Apache XBean OSGI Bundle Utilities
74 | Active | 80 | 4.17.0 | Apache XBean :: Finder shaded (repackaged)
75 | Active | 80 | 1.0.1.201505202024 | org.osgi:org.osgi.namespace.extender
76 | Active | 80 | 1.0.0.201505202024 | org.osgi:org.osgi.namespace.implementation
77 | Active | 80 | 1.0.0.201505202024 | org.osgi:org.osgi.namespace.service
78 | Active | 80 | 1.0.0.201810101357 | org.osgi:org.osgi.service.cdi
79 | Active | 80 | 1.1.0.201802012106 | org.osgi:org.osgi.util.function
80 | Active | 80 | 1.1.0.201802012106 | org.osgi:org.osgi.util.promise
81 | Active | 80 | 4.3.1.SNAPSHOT | Apache Karaf :: OSGi Services :: Event
134 | Active | 80 | 1.0.0 | Virtual reality server
135 | Active | 80 | 0.0.1.SNAPSHOT | VRComponent
136 | Active | 80 | 0.0.1.SNAPSHOT | VRFrame
142 | Active | 80 | 0.0.1.SNAPSHOT | Virtual reality integrated development environment (VRIDE)
karaf#root()>
But when I tried to start the VRIDE bundle, I get this exception:
10:00:42.193 WARN [fileinstall-C:\Program Files\apache-karaf-4.3.0/deploy] Error while creating extension
java.lang.NoClassDefFoundError: Lde/e_nexus/vr/tk/VRFrame;
at java.lang.Class.getDeclaredFields0(Native Method) ~[?:1.8.0_232]
at java.lang.Class.privateGetDeclaredFields(Class.java:2611) ~[?:1.8.0_232]
at java.lang.Class.getDeclaredFields(Class.java:1944) ~[?:1.8.0_232]
at org.apache.aries.cdi.container.internal.util.Reflection.allFields(Reflection.java:47) ~[!/:1.1.3]
at org.apache.aries.cdi.container.internal.annotated.AnnotatedTypeImpl.<init>(AnnotatedTypeImpl.java:42) ~[!/:1.1.3]
at org.apache.aries.cdi.container.internal.container.Discovery.lambda$discover$8(Discovery.java:133) ~[!/:1.1.3]
at java.util.HashMap$Values.forEach(HashMap.java:981) ~[?:1.8.0_232]
This is the Java-Class I tried to load:
package de.e_nexus.desktop.vr.ide;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.osgi.service.cdi.annotations.Reference;
import org.osgi.service.cdi.annotations.Service;
import de.e_nexus.vr.server.ClientKeyboardScancode;
import de.e_nexus.vr.server.VRClientHelmetAndControllerListener;
import de.e_nexus.vr.server.VRClientKeyboardListener;
import de.e_nexus.vr.server.VRServer;
import de.e_nexus.vr.server.listeners.VRClientRequestAppInfo;
import de.e_nexus.vr.server.listeners.VRClientStatusListener;
import de.e_nexus.vr.server.listeners.interaction.HelmetAndControllerInfo;
import de.e_nexus.vr.server.osgi.inter.VRServerService;
import de.e_nexus.vr.tk.VRFrame;
#ApplicationScoped
#Service
public class StartIDE implements VRClientStatusListener, VRClientRequestAppInfo, VRClientHelmetAndControllerListener, VRClientKeyboardListener {
/**
* The logger for this class.
*/
private static final Logger LOG = Logger.getLogger(StartIDE.class.getCanonicalName());
private final static Object lock = new Object();
private VRServer vrServer;
public void notifyStatus(boolean connected) {
if (!connected) {
synchronized (lock) {
lock.notify();
}
}
}
#Reference
#Inject
private VRServerService vrServerService;
private VRFrame applicationFrame;
#PostConstruct
public void initialize() {
LOG.fine("Starting VR IDE");
vrServer = vrServerService.getVRServer();
applicationFrame = new VRFrame(vrServer, "test");
LOG.info(getLatin1Title() + " started successfully!");
}
#PreDestroy
public void teardown() {
applicationFrame.remove();
LOG.info("Stoped " + getLatin1Title() + " successfully!");
vrServer = null;
}
public VRServer getVrServer() {
return vrServer;
}
#Override
public void notify(HelmetAndControllerInfo haci) {
}
#Override
public String getLatin1Title() {
return "VR IDE";
}
#Override
public void notifyKeyboardEvent(ClientKeyboardScancode[] downs, ClientKeyboardScancode[] ups, long incomingTime) {
System.out.println("me");
}
}
VRServer-Codebase
VRToolkit-Codebase
VRIDE-Codebase
EDIT:
Here is the complete stacktrace:
java.lang.NoClassDefFoundError: Lde/e_nexus/vr/tk/VRFrame;
at java.lang.Class.getDeclaredFields0(Native Method) ~[?:1.8.0_232]
at java.lang.Class.privateGetDeclaredFields(Class.java:2611) ~[?:1.8.0_232]
at java.lang.Class.getDeclaredFields(Class.java:1944) ~[?:1.8.0_232]
at org.apache.aries.cdi.container.internal.util.Reflection.allFields(Reflection.java:47) ~[!/:1.1.3]
at org.apache.aries.cdi.container.internal.annotated.AnnotatedTypeImpl.<init>(AnnotatedTypeImpl.java:42) ~[!/:1.1.3]
at org.apache.aries.cdi.container.internal.container.Discovery.lambda$discover$8(Discovery.java:133) ~[!/:1.1.3]
at java.util.HashMap$Values.forEach(HashMap.java:981) ~[?:1.8.0_232]
at org.apache.aries.cdi.container.internal.container.Discovery.discover(Discovery.java:130) ~[!/:1.1.3]
at org.apache.aries.cdi.container.internal.container.ContainerState.<init>(ContainerState.java:178) ~[!/:1.1.3]
at org.apache.aries.cdi.container.internal.Activator.doCreateExtension(Activator.java:209) [!/:1.1.3]
at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:242) [!/:1.1.3]
at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) [!/:1.1.3]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) [osgi.core-7.0.0.jar:?]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:420) [osgi.core-7.0.0.jar:?]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [osgi.core-7.0.0.jar:?]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) [osgi.core-7.0.0.jar:?]
at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915) [org.apache.felix.framework-6.0.3.jar:?]
at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) [org.apache.felix.framework-6.0.3.jar:?]
at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) [org.apache.felix.framework-6.0.3.jar:?]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4817) [org.apache.felix.framework-6.0.3.jar:?]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2336) [org.apache.felix.framework-6.0.3.jar:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) [org.apache.felix.framework-6.0.3.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [!/:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [!/:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [!/:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [!/:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [!/:3.6.8]
Caused by: java.lang.ClassNotFoundException: de.e_nexus.vr.tk.VRFrame not found by de.e-nexus.component [87]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1597) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_232]
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1375) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1618) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1548) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_232]
... 27 more

As the Logging points-out:
Caused by: java.lang.ClassNotFoundException: de.e_nexus.vr.tk.VRFrame not found by de.e-nexus.component [87]
What means Karaf is searching the VRFrame from the component submodule, which clearly does not exist.
That makes sense since all java packages are exported, the VRFrame's package is ambiguous. I followed what özkan pakdil said and renamed the java-packages to a unique name. Since that it works like a charm.
Thanks Özkan! Your answer includes some usefull hints and the source of my problem was the ambiguous package-name.

The main problem in the project is <extensions>true</extensions> in maven-bundle-plugin. You need to have it in your pom.xml. example code
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Activator>${Bundle-Activator}</Bundle-Activator>
<Export-Package>
de.*;version=${project.version}
</Export-Package>
<Import-Package>
*
</Import-Package>
</instructions>
</configuration>
</plugin>
And packaging should be bundle like <packaging>bundle</packaging> for the OSGI bundles. You can see how package created from this command
mvn archetype:generate \
-DarchetypeGroupId=org.apache.karaf.archetypes \
-DarchetypeArtifactId=karaf-bundle-archetype \
-DarchetypeVersion=4.3.0 \
-DgroupId=io.github.ozkanpakdil \
-DartifactId=myfirstbundle \
-Dversion=1.0-SNAPSHOT \
-Dpackage=io.github.ozkanpakdil
https://karaf.apache.org/manual/latest/#_creating_bundles is explaining nicely. Other then that I highly suggest have namespaces without underscore. Instead of "e_nexus" have enexus and for <groupId>de.e-nexus</groupId> have <groupId>de.enexus</groupId>. Last but not least instead of <artifactId>vr.server</artifactId> have <artifactId>vrserver</artifactId>, I am suggesting these because OSGI is already complicated enviroenment, having simple and easy names will make easier to catch errors and maintain the code. Also it will prevent problems in case you move to another OS, you never know how these behaves between OSes.
There were some warnings related to same namespace is in different jars, I changed the code in "frame" and "component" modules accordingly. Below is the log from local, I can see that VR-Client log, I think it started working as expected.
ozkan#DESKTOP-NF90OD6 MINGW64 /c/Program Files/apache-karaf-4.3.0/bin
$ ./karaf
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (4.3.0)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
Start Osgi spiced VR Server ... [OK] #10:23 (You might get asked by the firewall if you like to allow java to communicate to other systems. In order to connect the local VR-Client you are requested to grant the communication.)
karaf#root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID | State | Lvl | Version | Name
---+----------+-----+--------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------
31 | Active | 80 | 4.3.0 | Apache Karaf :: OSGi Services :: Event
55 | Active | 80 | 1.0.0 | Virtual reality server
56 | Active | 80 | 0.0.1.SNAPSHOT | VRComponent
57 | Active | 80 | 0.0.1.SNAPSHOT | VRFrame
58 | Active | 80 | 1.3.2 | Apache Aries SPI Fly Dynamic Weaving Bundle
59 | Active | 80 | 9.0.0 | org.objectweb.asm
60 | Active | 80 | 9.0.0 | org.objectweb.asm.commons
61 | Active | 80 | 9.0.0 | org.objectweb.asm.tree
62 | Active | 80 | 9.0.0 | org.objectweb.asm.tree.analysis
63 | Active | 80 | 9.0.0 | org.objectweb.asm.util
64 | Active | 80 | 2.0.17 | OpenWebBeans Core
65 | Active | 80 | 2.0.17 | SPI definition
66 | Active | 80 | 1.1.3 | Apache Aries CDI - CDI Component Runtime (CCR)
67 | Active | 80 | 1.1.3 | Apache Aries CDI - SPI classes for Portable Extensions
68 | Active | 80 | 1.1.3 | Apache Aries CDI - Container using Apache OpenWebBeans
69 | Active | 80 | 1.1.3 | Apache Aries CDI - SPI
70 | Active | 80 | 1.0.12 | Apache Felix Converter
71 | Active | 80 | 1.2.0 | Apache Geronimo JSR-330 Spec 1.0
72 | Active | 80 | 1.1.0 | Apache Geronimo Expression Language Spec 2.2
73 | Active | 80 | 1.2.0 | Apache Geronimo Interceptor Spec 1.2
74 | Active | 80 | 1.2.0 | Apache Geronimo JCDI Spec 2.0
75 | Active | 80 | 1.3.0.3 | Apache ServiceMix :: Specs :: Annotation API 1.3
76 | Active | 80 | 4.17.0 | Apache XBean :: ASM shaded (repackaged)
77 | Active | 80 | 4.17.0 | Apache XBean OSGI Bundle Utilities
78 | Active | 80 | 4.17.0 | Apache XBean :: Finder shaded (repackaged)
79 | Active | 80 | 1.0.1.201505202024 | org.osgi:org.osgi.namespace.extender
80 | Active | 80 | 1.0.0.201505202024 | org.osgi:org.osgi.namespace.implementation
81 | Active | 80 | 1.0.0.201505202024 | org.osgi:org.osgi.namespace.service
82 | Active | 80 | 1.0.0.201810101357 | org.osgi:org.osgi.service.cdi
83 | Active | 80 | 1.1.0.201802012106 | org.osgi:org.osgi.util.function
84 | Active | 80 | 1.1.0.201802012106 | org.osgi:org.osgi.util.promise
85 | Resolved | 80 | 4.3.1.SNAPSHOT | Apache Karaf :: OSGi Services :: Event
86 | Active | 80 | 0.0.1.SNAPSHOT | Virtual reality integrated development environment (VRIDE)
karaf#root()> log:display
10:23:10.508 INFO [activator-1-thread-2] Registering commands for bundle org.apache.karaf.log.core/4.3.0
10:23:10.821 INFO [activator-1-thread-2] Deployment finished. Registering FeatureDeploymentListener
10:23:10.821 INFO [activator-1-thread-2] Registering commands for bundle org.apache.karaf.features.command/4.3.0
10:23:10.828 INFO [activator-1-thread-3] Registering commands for bundle org.apache.karaf.kar.core/4.3.0
10:23:10.855 INFO [FelixStartLevel] Command registration delayed for bundle org.apache.karaf.shell.ssh/4.3.0. Missing service: [org.apache.sshd.server.SshServer]
10:23:10.871 INFO [FelixStartLevel] Registering commands for bundle org.apache.karaf.system.core/4.3.0
10:23:10.893 INFO [FelixStartLevel] Registering commands for bundle org.apache.karaf.event/4.3.0
10:23:11.089 INFO [activator-1-thread-1] Registering commands for bundle org.apache.karaf.shell.ssh/4.3.0
10:23:11.128 INFO [activator-1-thread-1] No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory
10:23:12.346 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.PackageStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=packageState,version=1.5,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.346 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.wiring.BundleWiringStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=wiringState,version=1.1,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.346 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.BundleStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=bundleState,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.351 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.ServiceStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=serviceState,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.352 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.FrameworkMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.353 INFO [activator-1-thread-1] Registering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.388 INFO [activator-1-thread-1] Unregistering org.osgi.jmx.framework.PackageStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=packageState,version=1.5,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.389 INFO [activator-1-thread-1] Unregistering org.osgi.jmx.framework.wiring.BundleWiringStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=wiringState,version=1.1,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.390 INFO [activator-1-thread-1] Unregistering org.osgi.jmx.framework.BundleStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=bundleState,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.390 INFO [activator-1-thread-1] Unregistering org.osgi.jmx.framework.ServiceStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=serviceState,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.391 INFO [activator-1-thread-1] Unregistering org.osgi.jmx.framework.FrameworkMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.392 INFO [activator-1-thread-1] Unregistering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#a766065 with name osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.394 WARN [activator-1-thread-1] Task rejected for JMX Notification dispatch of event [org.osgi.framework.ServiceEvent[source=[javax.management.MBeanServer]]] - Dispatcher may have been shutdown
10:23:12.420 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.PackageStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#4a85005 with name osgi.core:type=packageState,version=1.5,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.421 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.wiring.BundleWiringStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#4a85005 with name osgi.core:type=wiringState,version=1.1,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.422 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.BundleStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#4a85005 with name osgi.core:type=bundleState,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.423 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.ServiceStateMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#4a85005 with name osgi.core:type=serviceState,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.423 INFO [activator-1-thread-1] Registering org.osgi.jmx.framework.FrameworkMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#4a85005 with name osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3
10:23:12.424 INFO [activator-1-thread-1] Registering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer org.apache.karaf.management.internal.EventAdminMBeanServerWrapper#4a85005 with name osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=1ba06c85-21b1-4145-9726-b08a81b6cad3

Related

How to use ds in command bundle with karaf4.x?

I was trying karaf4.x with the DS(declarative service) in command bundles, but found it falied to get service via DS.
karaf.log
2017-07-10T15:01:43,163 | INFO | pipe-bundle:install -s mvn:com.gogo.sdn/opensdn-hello-cli/1.0-SNAPSHOT | CommandExtension | 38 - org.apache.karaf.shell.core - 4.1.1 | Command registration delayed for bundle com.gogo.sdn.opensdn-hello-cli/1.0.0.SNAPSHOT. Missing dependencies: [com.gogo.sdn.core.service.hello.HelloService]

Java class is not a valid argument to the jvm

I have a wrapper.conf file that contains the following (note I've omitted irrelevant entries such as .1, .2, .3, etc.):
set.default.JAVA_HOME=E:\DATA\Dev\jdk1.7.0_65
# Java Application
set.default.KARAF_BASE=E:\hsip-base-5.3.1.1b
wrapper.working.dir=%KARAF_BASE%
wrapper.java.command=java
wrapper.java.mainclass=org.apache.karaf.shell.wrapper.Main
wrapper.java.classpath.1=%KARAF_BASE%/lib/karaf-wrapper.jar
wrapper.java.classpath.2=%KARAF_HOME%/lib/karaf.jar
wrapper.java.classpath.3=%KARAF_HOME%/lib/karaf-jaas-boot.jar
wrapper.java.classpath.4=%KARAF_BASE%/lib/karaf-wrapper-main.jar
wrapper.java.library.path.1=%KARAF_BASE%/lib/
# JVM Parameters
wrapper.java.additional.4=org.apache.karaf.main.Main
On starting apache karaf I'm getting the following error:
STATUS | wrapper | 2017/01/30 14:42:52 | --> Wrapper Started as Service
WARN | wrapper | 2017/01/30 14:42:52 | The value of property 'wrapper.java.additional.4', 'org.apache.karaf.main.Main' is not a valid argument to the jvm. Skipping.
The jar file it is looking for and the class within are fine (%KARAF_BASE%/lib/karaf-wrapper-main.jar)
Is fine. A colleague had a similar problem and it was JVM related but cannot remember what.
Does anyone know where I can even start with this because it should work. I have java 8 on my machine, but I have removed all references to it and my JAVA_HOME is pointing at this version 7, don't know if that makes a difference.
Note, the actual stack traces are something like
INFO | jvm 1 | 2017/01/30 15:11:48 | ERROR: Bundle org.ops4j.pax.url.wrap [1] Error starting mvn:org.ops4j.pax.url/pax-url-wrap/1.2.8 (org.osgi.framework.BundleException: Unresolved constraint in bundle org.ops4j.pax.url.wrap [1]: Unable to resolve 1.0: missing requirement [1.0] package; (package=javax.net.ssl))
INFO | jvm 1 | 2017/01/30 15:11:48 | org.osgi.framework.BundleException: Unresolved constraint in bundle org.ops4j.pax.url.wrap [1]: Unable to resolve 1.0: missing requirement [1.0] package; (package=javax.net.ssl)
INFO | jvm 1 | 2017/01/30 15:11:48 | at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3564)
INFO | jvm 1 | 2017/01/30 15:11:48 | at org.apache.felix.framework.Felix.startBundle(Felix.java:1797)
INFO | jvm 1 | 2017/01/30 15:11:48 | at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
INFO | jvm 1 | 2017/01/30 15:11:48 | at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
INFO | jvm 1 | 2017/01/30 15:11:48 | at java.lang.Thread.run(Unknown Source)

Camel route with AMQP consumer runs ok in Eclipse, hangs in karaf

I am using Camel 2.17.3 and karaf 4.0.7 (also tried 4.0.1).
I have a Camel route that runs fine in Eclipse when a junit test starts it, but hangs when deployed to karaf. If I change the amqp: 'from' component to timer: the route runs fine in karaf.
My AMQP setup in the routebuilder is:
#Override
public void configure() throws Exception {
getContext().addComponent("amqp", AMQPComponent.amqpComponent(String.format("amqp://%s:%s?amqp.saslMechanisms=ANONYMOUS", AMQP_SERVICE_HOST, AMQP_SERVICE_PORT)));
Even this route will hang karaf, and run fine in Eclipse:
from("amqp:queue:myqueue").routeId("myRoute")
.log("temp")
In Karaf, when I say "hang", I observe these things:
If I try to exit karaf, it hangs - I need to kill the process.
If I try to stop the bundle, karaf hangs - I need to kill the process.
Neither camel:context-list nor camel:route-list return anything
I do not get a "route consuming from..." message in the log. This is all
the output from starting the bundle:
2016-10-08 23:46:00,593 | INFO | nsole user karaf | bundle
| 90 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | Bundle
Considered for SPI providers: mis-routes 2016-10-08 23:46:00,593 |
INFO | nsole user karaf | bundle | 90 -
org.apache.aries.spifly.dynamic.bundle - 1.0.1 | No 'SPI-Provider'
Manifest header. Skipping bundle: mis-routes 2016-10-08 23:46:05,595 |
INFO | ool-130-thread-1 | OsgiDefaultCamelContext | 56 -
org.apache.camel.camel-core - 2.17.3 | Apache Camel 2.17.3
(CamelContext: mis-routes) is starting 2016-10-08 23:46:05,599 | INFO
| ool-130-thread-1 | OsgiDefaultCamelContext | 56 -
org.apache.camel.camel-core - 2.17.3 | MDC logging is enabled on
CamelContext: mis-routes 2016-10-08 23:46:05,601 | INFO |
ool-130-thread-1 | ManagedManagementStrategy | 56 -
org.apache.camel.camel-core - 2.17.3 | JMX is enabled 2016-10-08
23:46:05,708 | INFO | ool-130-thread-1 |
DefaultRuntimeEndpointRegistry | 56 - org.apache.camel.camel-core -
2.17.3 | Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2016-10-08 23:46:05,804 | INFO | ool-130-thread-1 |
OsgiDefaultCamelContext | 56 - org.apache.camel.camel-core -
2.17.3 | AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as
it may improve performance. 2016-10-08 23:46:05,805 | INFO |
ool-130-thread-1 | OsgiDefaultCamelContext | 56 -
org.apache.camel.camel-core - 2.17.3 | StreamCaching is not in use. If
using streams then its recommended to enable stream caching. See more
details at http://camel.apache.org/stream-caching.html
Any help would be hugely appreciated. Thanks!
The reason should be related to this issue in Camel JIRA: https://issues.apache.org/jira/browse/CAMEL-10278
The main problem is proton-j 0.10 is incompatible with qpid-jms-client version 0.8. We upgraded the dependency to proton-j 0.12.0 and the fix will be available in the Camel 2.17.4 release.
For the moment you can use Camel 2.17.4-SNAPSHOT or upgrade the dependency in the Camel-Amqp Karaf feature.

Servicemix 5.4 waiting for unsatisfied dependencies [[&transactionManager, &userTransaction]

I want to upgrade servicemix 4.5.2 to servicemix 5.4 I already resolve dependency issues but I come across with problem in reference to service. When my hibernate bundle is started it can't get access to services transactionManager and userTransaction.
I tested both configuration(spring and blueprint) form https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html/EIP_Transactions_Guide/XaTM-Access.html but I cant get these services.
In osgi:list I see:
[102] [Active ] [ ] [ ] [ 50] Apache Aries Transaction Manager (1.0.0)
In my feature.xml in my hibernate bundle configuration I have <feature>transaction</feature>
In log file I see :
2015-06-16 15:03:58,868 | INFO | ExtenderThread-2 | OsgiBundleXmlApplicationContext | ? ? | 80 - org.apache.servicemix.bundles.spring-context - 3.2.11.RELEASE_1 | Application Context service already unpublished
2015-06-16 15:03:58,871 | INFO | ExtenderThread-2 | XmlBeanDefinitionReader | ? ? | 78 - org.apache.servicemix.bundles.spring-beans - 3.2.11.RELEASE_1 | Loading XML bean definitions from URL [bundle://230.0:0/META-INF/spring/beans.xml]
2015-06-16 15:03:58,905 | INFO | ExtenderThread-2 | DependencyServiceManager | ? ? | 123 - org.springframework.osgi.extender - 1.2.1 | Adding OSGi service dependency for importer [&transactionManager] matching OSGi filter [(objectClass=javax.transaction.TransactionManager)]
2015-06-16 15:03:58,905 | INFO | ExtenderThread-2 | DependencyServiceManager | ? ? | 123 - org.springframework.osgi.extender - 1.2.1 | Adding OSGi service dependency for importer [&userTransaction] matching OSGi filter [(objectClass=javax.transaction.UserTransaction)]
2015-06-16 15:03:58,905 | INFO | ExtenderThread-2 | DependencyServiceManager | ? ? | 123 - org.springframework.osgi.extender - 1.2.1 | OsgiBundleXmlApplicationContext(bundle=*****, config=osgibundle:/META-INF/spring/*.xml) is waiting for unsatisfied dependencies [[&transactionManager, &userTransaction]]
After timeout i get:
2015-06-16 15:08:58,911 | ERROR | Timer-1 | WaiterApplicationContextExecutor | ? ? | 123 - org.springframework.osgi.extender - 1.2.1 | Unable to create application context for [******], unsatisfied dependencies: Dependency on [(objectClass=javax.transaction.TransactionManager)] (from bean [&transactionManager]), Dependency on F[(objectClass=javax.transaction.UserTransaction)] (from bean [&userTransaction])
org.springframework.context.ApplicationContextException: Application context initialization for '*******' has timed out
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:454)[123:org.springframework.osgi.extender:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:50)[123:org.springframework.osgi.extender:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:105)[123:org.springframework.osgi.extender:1.2.1]
at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_21]
at java.util.TimerThread.run(Timer.java:505)[:1.7.0_21]
2015-06-16 15:08:58,914 | ERROR | Timer-1 | ContextLoaderListener | ? ? | 123 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=******, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.context.ApplicationContextException: Application context initialization for '*******' has timed out
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:454)[123:org.springframework.osgi.extender:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:50)[123:org.springframework.osgi.extender:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:105)[123:org.springframework.osgi.extender:1.2.1]
at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_21]
at java.util.TimerThread.run(Timer.java:505)[:1.7.0_21]
And:
karaf#root> bundle-services 102
You are about to access system bundle 102. Do you wish to continue (yes/no): yes
org.apache.aries.transaction.manager provides:
----------------------------------
[org.osgi.service.cm.ManagedService]
[javax.transaction.TransactionManager, javax.transaction.TransactionSynchronizationRegistry, javax.transaction.UserTransaction, org.apache.geronimo.transaction.manager.RecoverableTransactionManager, org.springframework.transaction.PlatformTransactionManager]
Solved by modifying the future.xml file on my hibernate bundle i added 'dependency="true"'. But still this is very strange behavior...

JBoss AS7 Service Wrapper problems

I'm trying to use Java Service Wrapper 3.3.5 32 bit community release with JBoss AS7 on a Windows 7 64 bit machine. I have a hunch the reason I'm having problems is due our 32 bit version, but we have been able to use the 32 bit version of jsw with other applications (ActiveMQ) successfully, so I thought I'd try the 32 bit version first. If it's advisable to upgrade to the pro version we will do so.
I'm pasting my wrapper.log and wrapper.conf below. Right now the service is not able to start normally. I tried troubleshooting the UnsatisfiedLinkError: no wrapper-windows-x86-32 in java.library.path error by making sure jsw was finding my java.library.path by hard coding paths for JAVA_HOME and JBOSS_HOME in my conf.
wrapper.log...
STATUS | wrapper | 2011/09/08 08:17:40 | --> Wrapper Started as Console
STATUS | wrapper | 2011/09/08 08:17:40 | Java Service Wrapper Community Edition 32-bit 3.5.9
STATUS | wrapper | 2011/09/08 08:17:40 | Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2011/09/08 08:17:40 | http://wrapper.tanukisoftware.com
STATUS | wrapper | 2011/09/08 08:17:40 |
DEBUG | wrapper | 2011/09/08 08:17:40 | The file "D:\jboss-as-7.0.0.Final\bin\wrapper.exe" is signed and the signature was verified.
DEBUG | wrapper | 2011/09/08 08:17:40 | Signer Certificate:
DEBUG | wrapper | 2011/09/08 08:17:40 | Serial Number:
DEBUG | wrapper | 2011/09/08 08:17:40 | 00 97 06 fe b5 6e 56 cc cb 66 3a bb 55 a7 a0 e4 76
DEBUG | wrapper | 2011/09/08 08:17:40 | Issuer Name: UTN-USERFirst-Object
DEBUG | wrapper | 2011/09/08 08:17:40 | Subject Name: Tanuki Software Ltd.
DEBUG | wrapper | 2011/09/08 08:17:40 | TimeStamp Certificate:
DEBUG | wrapper | 2011/09/08 08:17:40 | Serial Number:
DEBUG | wrapper | 2011/09/08 08:17:40 | 47 8a 8e fb 59 e1 d8 3f 0c e1 42 d2 a2 87 07 be
DEBUG | wrapper | 2011/09/08 08:17:40 | Issuer Name: UTN-USERFirst-Object
DEBUG | wrapper | 2011/09/08 08:17:40 | Subject Name: COMODO Time Stamping Signer
DEBUG | wrapper | 2011/09/08 08:17:40 | Date of TimeStamp : 2011/05/09 01:37
DEBUG | wrapper | 2011/09/08 08:17:40 | Release time: 2011/05/09 00:00:00
DEBUG | wrapper | 2011/09/08 08:17:40 | Build time: 2011/05/09 18:36:00
DEBUG | wrapper | 2011/09/08 08:17:40 | Timezone: Pacific Standard Time (Pacific Daylight Time) Offset: 28800, hasDaylight: 1
DEBUG | wrapper | 2011/09/08 08:17:40 | Using tick timer.
DEBUG | wrapper | 2011/09/08 08:17:40 | Current User: Administrator Domain: IP-0A60A398
DEBUG | wrapper | 2011/09/08 08:17:40 | Operating System ID: Microsoft Windows Server 2003 R2, Datacenter Edition Service Pack 2 (build 3790)
INFO | wrapper | 2011/09/08 08:17:40 |
INFO | wrapper | 2011/09/08 08:17:40 | Environment variables (Source | Name=Value) BEGIN:
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _PARAMETERS=
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _REALPATH=D:\jboss-as-7.0.0.Final\bin\
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _WRAPPER_BASE=wrapper
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _WRAPPER_CONF="../conf/wrapper.conf"
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _WRAPPER_CONF_DEFAULT=../conf/wrapper.conf
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _WRAPPER_EXE=D:\jboss-as-7.0.0.Final\bin\wrapper.exe
INFO | wrapper | 2011/09/08 08:17:40 | P---- | _WRAPPER_L_EXE=D:\jboss-as-7.0.0.Final\bin\wrapper-windows-x86-32.exe
INFO | wrapper | 2011/09/08 08:17:40 | P---- | ALLUSERSPROFILE=C:\Documents and Settings\All Users
INFO | wrapper | 2011/09/08 08:17:40 | P---- | APPDATA=C:\Documents and Settings\Administrator\Application Data
INFO | wrapper | 2011/09/08 08:17:40 | P---- | CLIENTNAME=JAMIEWORK
INFO | wrapper | 2011/09/08 08:17:40 | P---- | ClusterLog=C:\WINDOWS\Cluster\cluster.log
INFO | wrapper | 2011/09/08 08:17:40 | P---- | CommonProgramFiles=C:\Program Files\Common Files
INFO | wrapper | 2011/09/08 08:17:40 | P---- | COMPUTERNAME=IP-0A60A398
INFO | wrapper | 2011/09/08 08:17:40 | P---- | ComSpec=C:\WINDOWS\system32\cmd.exe
INFO | wrapper | 2011/09/08 08:17:40 | P---- | FP_NO_HOST_CHECK=NO
INFO | wrapper | 2011/09/08 08:17:40 | P---- | HOMEDRIVE=C:
INFO | wrapper | 2011/09/08 08:17:40 | P---- | HOMEPATH=\Documents and Settings\Administrator
INFO | wrapper | 2011/09/08 08:17:40 | P---C | JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
INFO | wrapper | 2011/09/08 08:17:40 | P---C | JBOSS_HOME=D:\jboss-as-7.0.0.Final
INFO | wrapper | 2011/09/08 08:17:40 | P---- | LOGONSERVER=\\IP-0A60A398
INFO | wrapper | 2011/09/08 08:17:40 | P---- | NUMBER_OF_PROCESSORS=1
INFO | wrapper | 2011/09/08 08:17:40 | P---- | OS=Windows_NT
INFO | wrapper | 2011/09/08 08:17:40 | P---- | Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\MySQL\MySQL Server 5.1\bin
INFO | wrapper | 2011/09/08 08:17:40 | P---- | PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
INFO | wrapper | 2011/09/08 08:17:40 | P---- | PROCESSOR_ARCHITECTURE=x86
INFO | wrapper | 2011/09/08 08:17:40 | P---- | PROCESSOR_IDENTIFIER=x86 Family 6 Model 26 Stepping 5, GenuineIntel
INFO | wrapper | 2011/09/08 08:17:40 | P---- | PROCESSOR_LEVEL=6
INFO | wrapper | 2011/09/08 08:17:40 | P---- | PROCESSOR_REVISION=1a05
INFO | wrapper | 2011/09/08 08:17:40 | P---- | ProgramFiles=C:\Program Files
INFO | wrapper | 2011/09/08 08:17:40 | P---- | PROMPT=$P$G
INFO | wrapper | 2011/09/08 08:17:40 | P---- | SESSIONNAME=RDP-Tcp#3
INFO | wrapper | 2011/09/08 08:17:40 | P---- | SystemDrive=C:
INFO | wrapper | 2011/09/08 08:17:40 | P---- | SystemRoot=C:\WINDOWS
INFO | wrapper | 2011/09/08 08:17:40 | P---- | TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1
INFO | wrapper | 2011/09/08 08:17:40 | P---- | TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1
INFO | wrapper | 2011/09/08 08:17:40 | P---- | USERDOMAIN=IP-0A60A398
INFO | wrapper | 2011/09/08 08:17:40 | P---- | USERNAME=Administrator
INFO | wrapper | 2011/09/08 08:17:40 | P---- | USERPROFILE=C:\Documents and Settings\Administrator
INFO | wrapper | 2011/09/08 08:17:40 | P---- | windir=C:\WINDOWS
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_ARCH=x86
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_BIN_DIR=D:\jboss-as-7.0.0.Final\bin
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_BITS=32
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_CONF_DIR=D:\jboss-as-7.0.0.Final\conf
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_FILE_SEPARATOR=\
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_HOST_NAME=ip-0A60A398
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_HOSTNAME=ip-0A60A398
INFO | wrapper | 2011/09/08 08:17:40 | P--W- | WRAPPER_INIT_DIR=D:\jboss-as-7.0.0.Final\bin
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_LANG=en
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_OS=windows
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_PATH_SEPARATOR=;
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_PID=4432
INFO | wrapper | 2011/09/08 08:17:40 | ---W- | WRAPPER_WORKING_DIR=D:\jboss-as-7.0.0.Final\bin
INFO | wrapper | 2011/09/08 08:17:40 | Environment variables END:
INFO | wrapper | 2011/09/08 08:17:40 |
DEBUG | wrapper | 2011/09/08 08:17:40 | Use tick timer mutex=FALSE
DEBUG | wrapper | 2011/09/08 08:17:40 | active log file changed: ..\standalone\log\wrapper.log
DEBUG | wrapperp | 2011/09/08 08:17:40 | server listening on port 32001.
DEBUG | wrapper | 2011/09/08 08:17:40 | Ping settings: wrapper.ping.interval=5, wrapper.ping.interval.logged=1, wrapper.ping.timeout=30
STATUS | wrapper | 2011/09/08 08:17:40 | Launching a JVM...
INFO | wrapper | 2011/09/08 08:17:40 | Command: "C:\Program Files\Java\jdk1.6.0_16\bin\java" -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.tanukisoftware.wrapper.WrapperManager.mbean=false -Dlogging.configuration=file:D:\jboss-as-7.0.0.Final/standalone/configuration/logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl -Djava.library.path="../lib" -classpath "D:\jboss-as-7.0.0.Final\lib\wrapper.jar;C:\Program Files\Java\jdk1.6.0_16/lib/tools.jar;D:\jboss-as-7.0.0.Final/bin/run.jar;D:\jboss-as-7.0.0.Final/jboss-modules.jar" -Dwrapper.key="2DBcrdYsF4TkOie9" -Dwrapper.port=32001 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=4432 -Dwrapper.version="3.5.9" -Dwrapper.native_library="wrapper" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperJarApp D:\jboss-as-7.0.0.Final\bin\run.jar -mp D:\jboss-as-7.0.0.Final\modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=D:\jboss-as-7.0.0.Final
DEBUG | wrapper | 2011/09/08 08:17:40 | JVM started (PID=5064)
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: WrapperManager class initialized by thread: main Using classloader: sun.misc.Launcher$AppClassLoader#11b86e7
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager: Initializing...
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: JVM #1
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Running a 32-bit JVM.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: org.tanukisoftware.wrapper.WrapperManager package information:
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Implementation Title: org.tanukisoftware.wrapper
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Implementation Vendor: Tanuki Software, Ltd.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Implementation Version: 3.5.9
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Is Sealed?: False
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: org.tanukisoftware.wrapper.WrapperManager protection domain:
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Location: file:/D:/jboss-as-7.0.0.Final/lib/wrapper.jar
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Size: 118,538
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: MD5: 0bb27af3979eaf3a593af1a3d63e9367
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Registering shutdown hook
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Using wrapper
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Load native library. One or more attempts may fail if platform specific libraries do not exist. This is NORMAL and is only a problem if they all fail.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Unable to load native library: wrapper-windows-x86-32.dll Cause: no wrapper-windows-x86-32 in java.library.path
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Loaded native library:
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Loaded native localization method.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Calling native initialization method.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJNI Debug: Initializing WrapperManager native library.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJNI Debug: Java Executable: C:\Program Files\Java\jdk1.6.0_16\bin\java.exe
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJNI Debug: Native Library: D:\jboss-as-7.0.0.Final\lib\wrapper.dll
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJNI Debug: Windows version: 5.2.3790
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Java Version : 1.6.0_16-b01 Java HotSpot(TM) Client VM
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Java VM Vendor : Sun Microsystems Inc.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: OS Name : Windows 2003
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: OS Arch : x86
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug:
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: Jar Main-Class: org.jboss.Main
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: Jar Classpath: ../client/getopt.jar
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: Classpath[0]=file:D:/jboss-as-7.0.0.Final/bin/run.jar
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: Classpath[1]=file:D:/jboss-as-7.0.0.Final/bin/../client/getopt.jar
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: WrapperManager.start(org.tanukisoftware.wrapper.WrapperJarApp#14693c7, args["-mp", "D:\jboss-as-7.0.0.Final\modules", "-logmodule", "org.jboss.logmanager", "-jaxpmodule", "javax.xml.jaxp-provider", "org.jboss.as.standalone", "-Djboss.home.dir=D:\jboss-as-7.0.0.Final"]) called by thread: main
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Control event monitor thread started.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Startup runner thread started.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Communications runner thread started.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Open socket to wrapper...Wrapper-Connection
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Unable to open socket to Wrapper from port 31,000, already in use.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Unable to open socket to Wrapper from port 31,001, already in use.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Opened Socket from 31,002 to 32,001
DEBUG | wrapper | 2011/09/08 08:17:41 | Pause reading child process output to share cycles.
DEBUG | wrapperp | 2011/09/08 08:17:41 | accepted a socket from 127.0.0.1 on port 31002
DEBUG | wrapperp | 2011/09/08 08:17:41 | closing backend server.
DEBUG | wrapperp | 2011/09/08 08:17:41 | read a packet KEY : 2DBcrdYsF4TkOie9
DEBUG | wrapper | 2011/09/08 08:17:41 | Got key from JVM: 2DBcrdYsF4TkOie9
DEBUG | wrapperp | 2011/09/08 08:17:41 | send a packet LOW_LOG_LEVEL : 1
DEBUG | wrapperp | 2011/09/08 08:17:41 | send a packet LOGFILE : ..\standalone\log\wrapper.log
DEBUG | wrapperp | 2011/09/08 08:17:41 | send a packet PROPERTIES : (Property Values)
DEBUG | wrapper | 2011/09/08 08:17:41 | Start Application.
DEBUG | wrapperp | 2011/09/08 08:17:41 | send a packet START : start
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Send a packet KEY : 2DBcrdYsF4TkOie9
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: handleBackend()
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Received a packet LOW_LOG_LEVEL : 1
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: LowLogLevel from Wrapper is 1
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Received a packet LOGFILE : ..\standalone\log\wrapper.log
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Received a packet PROPERTIES : (Property Values)
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Received a packet START : start
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Java temporary directory: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: calling WrapperListener.start()
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: WrapperListener.start runner thread started.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: start(args) Will wait up to 2 seconds for the main method to complete.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: invoking main method
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: main method completed
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperJarApp Debug: start(args) end. Main Completed=true, exitCode=null
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: returned from WrapperListener.start()
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Send a packet STARTED :
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: WrapperListener.start runner thread stopped.
INFO | jvm 1 | 2011/09/08 08:17:41 | jboss: unused non-option argument: D:\jboss-as-7.0.0.Final\modules
INFO | jvm 1 | 2011/09/08 08:17:41 | jboss: unused non-option argument: org.jboss.logmanager
INFO | jvm 1 | 2011/09/08 08:17:41 | jboss: option '-j, --jaxp' no longer supported
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: ShutdownHook started
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Send a packet STOP : 0
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Startup runner thread stopped.
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Stopped checking for control events.
DEBUG | wrapperp | 2011/09/08 08:17:41 | read a packet STARTED :
DEBUG | wrapper | 2011/09/08 08:17:41 | JVM signaled that it was started.
DEBUG | wrapperp | 2011/09/08 08:17:41 | read a packet STOP : 0
DEBUG | wrapper | 2011/09/08 08:17:41 | JVM requested a shutdown. (0)
DEBUG | wrapper | 2011/09/08 08:17:41 | wrapperStopProcess(0, FALSE) called.
DEBUG | wrapper | 2011/09/08 08:17:41 | Sending stop signal to JVM
DEBUG | wrapperp | 2011/09/08 08:17:41 | send a packet STOP : NULL
INFO | jvm 1 | 2011/09/08 08:17:41 | WrapperManager Debug: Received a packet STOP :
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: calling listener.stop()
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperJarApp Debug: stop(0)
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: returned from listener.stop() -> 0
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: shutdownJVM(0) Thread: Wrapper-Shutdown-Hook
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: wait for 0 shutdown locks to be released.
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: Send a packet STOPPED : 0
DEBUG | wrapperp | 2011/09/08 08:17:42 | read a packet STOPPED : 0
DEBUG | wrapper | 2011/09/08 08:17:42 | JVM signaled that it was stopped.
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: Closing backend connection.
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: Closed backend socket: java.net.SocketException: socket closed
INFO | jvm 1 | 2011/09/08 08:17:42 | WrapperManager Debug: Returned from backend handler.
DEBUG | wrapperp | 2011/09/08 08:17:42 | socket read no code (closed?).
DEBUG | wrapperp | 2011/09/08 08:17:42 | closing backend socket.
INFO | jvm 1 | 2011/09/08 08:17:43 | WrapperManager Debug: Server daemon shut down
INFO | jvm 1 | 2011/09/08 08:17:43 | WrapperManager Debug: ShutdownHook complete
DEBUG | wrapper | 2011/09/08 08:17:43 | JVM process exited with a code of 1, setting the wrapper exit code to 1.
DEBUG | wrapper | 2011/09/08 08:17:43 | JVM exited normally.
STATUS | wrapper | 2011/09/08 08:17:43 | <-- Wrapper Stopped
wrapper.conf...
#encoding=UTF-8
# Configuration files must begin with a line specifying the encoding
# of the the file.
#********************************************************************
# Wrapper License Properties (Ignored by Community Edition)
#********************************************************************
# Professional and Standard Editions of the Wrapper require a valid
# License Key to start. Licenses can be purchased or a trial license
# requested on the following pages:
# http://wrapper.tanukisoftware.com/purchase
# http://wrapper.tanukisoftware.com/trial
# Include file problems can be debugged by removing the first '#'
# from the following line:
##include.debug
# The Wrapper will look for either of the following optional files for a
# valid License Key. License Key properties can optionally be included
# directly in this configuration file.
#include ../conf/wrapper-license.conf
#include ../conf/wrapper-license-%WRAPPER_HOST_NAME%.conf
# The following property will output information about which License Key(s)
# are being found, and can aid in resolving any licensing problems.
#wrapper.license.debug=TRUE
#********************************************************************
# Wrapper Localization
#********************************************************************
# Specify the locale which the Wrapper should use. By default the system
# locale is used.
#wrapper.lang=en_US # en_US or ja_JP
# Specify the location of the Wrapper's language resources. If these are
# missing, the Wrapper will default to the en_US locale.
wrapper.lang.folder=../lang
#********************************************************************
# Wrapper Java Properties
#********************************************************************
# Java Application
# Locate the java binary on the system PATH:
#wrapper.java.command=java
# Specify a specific java binary:
set.JBOSS_HOME=D:\jboss-as-7.0.0.Final
set.JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
wrapper.java.command=%JAVA_HOME%/bin/java
# Tell the Wrapper to log the full generated Java command line.
wrapper.java.command.loglevel=INFO
# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperJarApp
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=%JBOSS_HOME%\lib\wrapper.jar
wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar
wrapper.java.classpath.3=%JBOSS_HOME%/bin/run.jar
wrapper.java.classpath.4=%JBOSS_HOME%/*.jar
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib
# Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE
# Java Additional Parameters
wrapper.java.additional.1=-XX:MaxPermSize=512m
wrapper.java.additional.2=-Dorg.jboss.resolver.warning=true
wrapper.java.additional.3=-Dsun.rmi.dgc.client.gcInterval=3600000
wrapper.java.additional.4=-Dsun.rmi.dgc.server.gcInterval=3600000
wrapper.java.additional.5=-Djboss.modules.system.pkgs=org.jboss.byteman
wrapper.java.additional.6=-Dorg.tanukisoftware.wrapper.WrapperManager.mbean=false
wrapper.java.additional.7=- Dlogging.configuration=file:%JBOSS_HOME%/standalone/configuration/logging.properties
wrapper.java.additional.8=- Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl
# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=128
# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=512
# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=%JBOSS_HOME%\bin\run.jar
wrapper.app.parameter.2=-mp
wrapper.app.parameter.3=%JBOSS_HOME%\modules
wrapper.app.parameter.4=-logmodule
wrapper.app.parameter.5=org.jboss.logmanager
wrapper.app.parameter.6=-jaxpmodule
wrapper.app.parameter.7=javax.xml.jaxp-provider
wrapper.app.parameter.8=org.jboss.as.standalone
wrapper.app.parameter.9=-Djboss.home.dir=%JBOSS_HOME%
Anyone know what's going on? Any advice appreciated.
JBoss AS7 has changed in several ways how it is launching.
You are using Integration method 1, however it seems that you are passing in a jar file as the first parameter to org.tanukisoftware.wrapper.WrapperSimpleApp. WrapperSimpleApp expects the name of your main class as parameter. So you should go for integration method 4 and pass the jar file to org.tanukisoftware.wrapper.WrapperJarApp.
We have had some guys recently with the same questions and helped them resolving the problem:
https://issues.jboss.org/browse/AS7-1547
Hope this information helps you out.
To me, based on what I see in the following line, it appears that your arguments to the JVM might be off a little? This error is unusual looking:
WrapperSimpleApp: Unable to locate the class -mp:
java.lang.ClassNotFoundException: -mp
In order for this to work, doesn't the main class in JBoss AS7 need to extend the tanukisoftware service interface class? I realize that extending that class isn't required but I do know that if JBoss didn't extend it, then you wont have some of the functionality that you might be trying to use from the wrapper.
Therefor, if you get TOTALLY stuck, you could create your own secondary wrapper class that extends the tanuki wrapper and it calls the JBoss main class from itself. Sorta like a simple wrapper around the tanuki wrapper.

Categories