Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] java.lang.NoClassDefFoundError when executing outside Eclipse

We use tycho to produce our Eclipse maven builds. We create a product (eclipse-repository) and use a target platform (eclipse-target-definition). The  problem that I'm having is after the tycho build in Eclipse, I can successfully run the app using the "Launch an Eclipse Application" option from within Eclipse, but when we attempt to run the generated C:\<proj_dir>\com.sma.em.product\target\products\com.sma.ui.em.product\win32\win32\x86\EnterpriseManager.exe from the command line, I get the following exception:


!SESSION 2016-04-08 11:21:22.201 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86 -debug

!ENTRY org.eclipse.osgi 4 0 2016-04-08 11:21:27.091
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: com/sma/ui/core/widgets/dialogs/ProgressTitleAreaDialog
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:272)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:327)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:402)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sma.ui.application.Application.showLoginDialog(Application.java:83)
at com.sma.ui.application.Application.start(Application.java:36)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Caused by: java.lang.ClassNotFoundException: com.sma.ui.core.widgets.dialogs.ProgressTitleAreaDialog cannot be found by com.sma.ui.em_16.0.0.201604081605
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 28 more

What could be the cause of the issue? I've attached the product file (EnterpriseManager.product) and the product pom file, as well as the main configurator pom.xml

Attachment: EnterpriseManager.product
Description: EnterpriseManager.product

<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
	<modelVersion>4.0.0</modelVersion>
	<groupId>sma-em</groupId>
	<artifactId>com.sma.em.build.tychomain</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>

	<properties>
		<tycho-version>0.22.0</tycho-version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<plugins>
			<plugin>
				<!-- enable tycho build extension -->
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<target>
						<artifact>
							<groupId>sma-em</groupId>
							<artifactId>com.sma.em.build.targetplatform</artifactId>
							<version>0.0.1-SNAPSHOT</version>
						</artifact>
					</target>
					<environments>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
				</configuration>
			</plugin>
		</plugins>
	</build>


	<modules>
		<module>../../features/com.sma.feature.enterprisemanager</module>
		<module>../com.sma.em.build.targetplatform</module>
		<module>../com.sma.em.product</module>
		<module>../../plugins/com.sma.core</module>
	</modules>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>com.sma.em.product</artifactId>
	<version>16.0.0-SNAPSHOT</version>
	<packaging>eclipse-repository</packaging>

	<parent>
		<groupId>sma-em</groupId>
		<artifactId>com.sma.em.build.tychomain</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../com.sma.em.build.tychomain</relativePath>
	</parent>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-repository-plugin</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<includeAllDependencies>true</includeAllDependencies>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-director-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<!-- install the product using the p2 director -->
						<id>materialize-products</id>
						<goals>
							<goal>materialize-products</goal>
						</goals>
					</execution>
					<execution>
						<!-- create zip file with the installed product -->
						<id>archive-products</id>
						<goals>
							<goal>archive-products</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>  
  
</project>

Back to the top