I have a .bat file that is creating the workspace for eclipse when executed on windows.
I want to import the maven projects when the .bat file is executed.(instead of manually adding the maven projects in eclipse)
So I added in the .bat file:
call mvn -Declipse.workspace=eclipseWorkspace eclipse:add-maven-repo
call eclipse -nosplash -application
org.eclipse.cdt.managedbuilder.core.headlessbuild -importAll
"svn://Repository..."
but got this error for the second call eclipse..:
!MESSAGE Application error !STACK 1 java.lang.RuntimeException:
Application "org.eclipse.cdt.managedbuilder.core.headlessbuild" could
not be found in the registry. The applications available are:
org.eclipse.ant.core.antRunner,
org.eclipse.e4.ui.workbench.swt.E4Application,
org.eclipse.e4.ui.workbench.swt.GenTopic,
org.eclipse.equinox.app.error, org.eclipse.equinox.p2.director,
org.eclipse.equinox.p2.garbagecollector.application,
org.eclipse.equinox.p2.publisher.InstallPublisher,
org.eclipse.equinox.p2.publisher.EclipseGenerator,
org.eclipse.equinox.p2.publisher.ProductPublisher,
org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher,
org.eclipse.equinox.p2.reconciler.application,
org.eclipse.equinox.p2.repository.repo2runnable,
org.eclipse.equinox.p2.repository.metadataverifier,
org.eclipse.equinox.p2.artifact.repository.mirrorApplication,
org.eclipse.equinox.p2.metadata.repository.mirrorApplication,
org.eclipse.equinox.p2.touchpoint.natives.nativePackageExtractor,
org.eclipse.equinox.p2.updatesite.UpdateSitePublisher,
org.eclipse.equinox.p2.publisher.UpdateSitePublisher,
org.eclipse.equinox.p2.publisher.CategoryPublisher,
org.eclipse.jdt.apt.core.aptBuild, org.eclipse.ui.ide.workbench,
org.eclipse.ant.ui.antRunner,
org.eclipse.help.base.infocenterApplication,
org.eclipse.help.base.helpApplication,
org.eclipse.help.base.indexTool,
org.eclipse.jdt.core.JavaCodeFormatter,
org.eclipse.jdt.core.JavaIndexer. at
org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
at
org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
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(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497) 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)
I could not find an example how to import maven project into eclipse through cmd. If someone can share some knowledge it will be highly appreciated.
Regards,
Kire
What is the reason you import it headless?
If you want to provide a "taylormade" Eclipse incl. Workspace you can try Oomph or Eclipse Profiles -> http://profiles.yatta.de?download. Eclipse Profiles has SVN ...
Related
I'm trying to use ObjectAid tool for UML diagram.
When I tried to create UML diagram for my package, in spring boot project
(⌘ + N -> ObjectAid Class Diagram ) , and when I hit finish, nothing happens, the window remains as it is, but in log, an exception appears.
The below exception appears each time I click on 'finish'.:-
java.lang.NoClassDefFoundError: Could not initialize class com.thoughtworks.xstream.converters.collections.PropertiesConverter
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:647)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:342)
at com.objectaid.uml.model.persistence.DiagramXStream.<init>(DiagramXStream.java:30)
at com.objectaid.uml.model.diagram.DiagramFactory.createXStream(DiagramFactory.java:99)
at com.objectaid.uml.model.diagram.DiagramFactory.getStream(DiagramFactory.java:89)
at com.objectaid.uml.model.diagram.DiagramFactory.marshal(DiagramFactory.java:268)
at com.objectaid.uml.model.diagram.DiagramFactory.marshalComplete(DiagramFactory.java:297)
at com.objectaid.uml.editor.NewDiagramWizard.createNewFile(NewDiagramWizard.java:99)
at com.objectaid.uml.editor.NewDiagramWizard.performFinish(NewDiagramWizard.java:59)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:832)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:472)
at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4441)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4227)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3837)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
at org.eclipse.jface.window.Window.open(Window.java:799)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:263)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:283)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:142)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4441)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4227)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3837)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
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:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
I am on mac, followed installation instructions from official page: https://www.objectaid.com/install-objectaid
Eclipse version:
Eclipse IDE for Enterprise Java and Web Developers (includes
Incubating components)
Version: 2021-06 (4.20.0) Build id: 20210612-2011
It seems that ObjectAid is no longer maintained. I got this error running on JDK17.
There is a workaround:
Download xstream 1.4.18 jar
Locate the com.objectaid.uml_1.2.4.jar file and open it (with the zip tool of your choice)
Delete the xstream-1.3.1.jar file inside the lib directory. Add the xstream-1.4.18.jar to the lib directory.
Open the file META-INF/MANIFEST.MF and replace line lib/xstream-1.3.1.jar with lib/xstream-1.4.18.jar.
Add to your eclipse.ini the following vmargs: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED
Restart Eclipse with -clean to ensure the OSGI cache is purged.
Working with Eclipse 2022-09 and Java 17, I faced similar issues as described initially. For that I just followed the points 1 .- 4., but worked on an "installation archive" of ObjectAID.
Instead of editing the eclipse.ini, I simply uninstalled the 'old' ObjectAID and re-installed it from that edited "installation archive". That worked!
I have inherited an existing RCP project, and I am totally new to how this type of project works.
I am running Eclipse IDE for Java Developers (Version: Oxygen.3 Release (4.7.3)).
When I try to run the project as an Eclipse application, I get the following error:
java.lang.NullPointerException
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.<init>(ModelServiceImpl.java:122)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:511)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
I have seen some solutions for this issue saying org.eclipse.equinox.ds and org.eclipse.equinox.event are required to be included in the plugin dependencies, but this has not solved my problem.
To solve this issue, I did the following:
Delete my Run configuration: Run > Run Configuration, then select the configuration, press big red x button, close
Created product configuration: File > New > Other, then Plugin Development > Product Configuration, next, select project, provide product configuration filename, finish
Product configuration file should be opened automatically (if not, open it), then, select Contents tab, and add the org.eclipse.equinox.event plugin
Select Configuration tab, add org.eclipse.equinox.event to Start Levels and set Auto-Start to true
I was getting this exception but I am not able to understand what is happening there.
Because on compilation time my class able access apache POI classes but on runtime my classes throws exception that he is not able find
org.apache.poi.xssf.usermodel.XSSFWorkbook.
Till now whatever solution is provided on net I have tried everything but not understanding what I am missing.
And weird thing is same code and same Apache POI library working on my friend's eclipse. We both have identical projects. Don't understand what is going on there.
I checked all folder's access where I am referring libraries.
Please share if you have any suggestion.
I am getting the following exception.
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: org/apache/poi/xssf/usermodel/XSSFWorkbook
at com.herzog.pmide.mergedconfigxml.ui.editors.DocumentGenerator.prepareScadaIOListExcel(DocumentGenerator.java:94)
at com.herzog.pmide.mergedconfigxml.ui.editors.DocumentGenerator.scadaIOList(DocumentGenerator.java:77)
at com.herzog.pmide.mergedconfigxml.ui.actions.DocumentGeneratorAction.run(DocumentGeneratorAction.java:47)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:253)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:331)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:331)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at com.herzog.pmide.application.Application.start(Application.java:20)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook cannot be found by com.herzog.pmide.mergedconfigxml.ui_1.0.0.qualifier
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
MANIFEST.MF as follow
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui
Bundle-SymbolicName: com.herzog.pmide.mergedconfigxml.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.herzog.pmide.mergedconfigxml.ui.Activator
Bundle-Vendor: Example
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.emf.ecore.xmi,
org.eclipse.emf.edit.ui,
com.herzog.pmide.machinelib.model.edit,
org.eclipse.ui.forms,
org.eclipse.ui.workbench,
org.eclipse.ui.ide,
com.herzog.pmide.mergedconfigxml.model.edit,
org.eclipse.gef,
com.herzog.pmide.tools.importutility,
com.herzog.pmide.machinelib.model,
org.eclipse.swt,
org.eclipse.emf.query,
com.herzog.pmide.mergedconfigxml.model,
org.eclipse.ui.editors,
org.eclipse.emf.validation,
org.eclipse.emf.validation.ui,
org.slf4j.api,
org.junit,
org.eclipse.emf.compare,
org.eclipse.emf.compare.edit,
org.eclipse.emf.compare.ide.ui,
org.eclipse.compare,
org.apache.commons.io,
org.eclipse.core.filesystem,
de.vonloesch.pdf4Eclipse,
de.vonloesch.pdf4eclipse.help,
com.herzog.pmide.routingline.model
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: com.herzog.pmide.mergedconfigxml.ui,
com.herzog.pmide.mergedconfigxml.ui.editors.unitconfig,
com.herzog.pmide.mergedconfigxml.ui.views
Bundle-Localization: OSGI-INF/l10n/message
build.properties as follow
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
icons/,\
OSGI-INF/l10n/message.properties
A plugin can only access classes in other plugins or in jars included in the plugin which are included in the bundle class path. Setting the Java Build Path properties does not configure the plugin correctly.
Add all the jars you need to the plugin, usually these are put in a 'lib' directory.
Update the build.properties to include these jars in the 'bin.includes' section. For example:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.properties,\
plugin.xml,\
lib/,\
lib/jogg-0.0.7.jar,\
lib/jorbis-0.0.15.jar,\
lib/vorbisspi1.0.2.jar
Here I have 3 jars in a lib directory (these are not the POI jars, this is just an example from one of my projects).
Update the MANIFEST.MF and set the Bundle-Classpath to include the jars. You can do this in the MANIFEST.MF editor in the 'Runtime' tab in the 'Classpath' section (use the Add... button to the right of the list and choose the libraries in the plugin). Be sure to leave the entry for '.'. Your MANIFEST.MF should end up containing a `Bundle-Classpath' entry like this:
Bundle-ClassPath: .,
lib/jogg-0.0.7.jar,
lib/jorbis-0.0.15.jar,
lib/vorbisspi1.0.2.jar
I am receiving this error after completing my project setup in IntelliJ. If I build my project in Netbeans or Eclipse, I can compile just fine.
Error:Abnormal build process termination:
Build process started. Classpath: /C:/Program Files (x86)/JetBrains/IntelliJ IDEA 14.1.4/lib/jps-launcher.jar;C:/Program Files/Java/jdk1.8.0_51/lib/tools.jar;/C:/Program Files (x86)/JetBrains/IntelliJ IDEA 14.1.4/lib/optimizedFileManager.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA 14.1.4/lib/ecj-4.4.jar
Exception in thread "main" 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:497)
at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:58)
Caused by: java.lang.NoSuchMethodError: io.netty.channel.nio.NioEventLoopGroup.<init>(ILjava/util/concurrent/Executor;)V
at org.jetbrains.jps.cmdline.BuildMain.main(BuildMain.java:97)
... 5 more
I'm using Ant 1.9.3 and Tomcat version 8.0. I'm using the Ant deploy target to deploy web apps in the Apache Tomcat using the manager credentials. The deploy target fails with the following exception:
java.lang.NoClassDefFoundError:
org/apache/tomcat/util/codec/binary/Base64
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:204)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:196)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.codec.binary
.Base64
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 19 more
When I tried to find the class Base64 in the package org\apache\tomcat\util\codec\binary\ which is in tomcat-util.jar, and it is in the classpath which I've verified by an echo in Ant build file.
I'm not able to solve the issue.
Just in case someone runs into the same problem I was having:
I was following the tutorial on the Tomcat website and I ran into the same NoClassDefFoundError issue when I tried to run ant install.
The tutorial mentions that you have to copy $CATALINA_HOME/lib/catalina-ant.jar1 (which contains the implementation code for the Ant custom tasks) to the lib directory of your Ant installation.
It does not mention, however, that you need to do the same thing for tomcat-util.jar. As soon as I copied tomcat-util.jar to my Ant directory, things started working (source).
1$CATALINA_HOME is the directory of your Tomcat installation, e.g. /usr/share/tomcat8
Please make sure you have added the tomcat-util.jar in the classpath as below.
<path id="catalina-ant-classpath">
<!-- We need the Catalina jars for Tomcat -->
<!-- * for other app servers - check the docs -->
<fileset dir="${appserver.lib}">
<include name="catalina-ant.jar"/>
<include name="tomcat-util.jar"/>
</fileset>
</path>