Sonar ANT task integration error - java

Java and ANT versions:
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Sonar version: 3.3.2
Sonar Ant Task version: 2.0, using sonar-ant-task-2.0.jar
I am getting this below error when I run the build script. I tried with setting the below properties in build script as well but keeps getting the below error. Please let me know if anyone has any solution.
sonar.sourceEncoding with value Windows-1252
sonar.supportSourceFileDuplications with value as true
Error:
BUILD FAILED
D:\TestProj\build-sonar.xml:40: org.sonar.api.utils.SonarException: Unable to read and import the source file : 'D:\TestProj\WEB-INF\src\com\iwf\ImageSearchCommand.java' with the charset : 'windows-1252'.
at org.sonar.plugins.java.JavaSourceImporter.importSource(JavaSourceImporter.java:86)
at org.sonar.plugins.java.JavaSourceImporter.parseDirs(JavaSourceImporter.java:70)
at org.sonar.plugins.java.JavaSourceImporter.analyse(JavaSourceImporter.java:63)
at org.sonar.plugins.java.JavaSourceImporter.analyse(JavaSourceImporter.java:59)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
at org.sonar.batch.phases.Phases.execute(Phases.java:97)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:128)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:114)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:104)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:121)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.Batch.execute(Batch.java:104)
at org.sonar.runner.DeprecatedAntLauncher.execute(DeprecatedAntLauncher.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.DeprecatedAntTaskExecutor.delegateExecution(DeprecatedAntTaskExecutor.java:110)
at org.sonar.runner.DeprecatedAntTaskExecutor.execute(DeprecatedAntTaskExecutor.java:65)
at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:86)
at org.sonar.ant.SonarTask.execute(SonarTask.java:75)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)Caused by: org.sonar.api.resources.DuplicatedSourceException: Duplicate source for resource: com.iwf.ImageSearchCommand
at org.sonar.batch.index.SourcePersister.saveSource(SourcePersister.java:45)
at org.sonar.batch.index.DefaultPersistenceManager.setSource(DefaultPersistenceManager.java:78)
at org.sonar.batch.index.DefaultIndex.setSource(DefaultIndex.java:419)
at org.sonar.batch.DefaultSensorContext.saveSource(DefaultSensorContext.java:161)
at org.sonar.plugins.java.JavaSourceImporter.importSource(JavaSourceImporter.java:83)

Sounds like:
SONAR-2444
Root cause is a source and test file of the same name. Solution is to exclude test files from Sonar analysis

Related

Unable to Run 64 Bit JDK for java FX Project in Netbeans 8.2

I am trying to run a JavaFX Project in my Netbeans 8.2. When I compile/build the project I get this error.
I am running into this issue while while using JDK 64 bit. The compiling/building/packaging works when JDK of 32 Bit is used.
ant -f C:\\Nikesh\\Label\\LabelPrint jfxsa-run
C:\\Nikesh\\Label\\LabelPrint\nbproject\jfx-impl.xml:151: Execute failed:
java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_131\bin\java" (in directory "C:\\Nikesh\\Label\\LabelPrint"): CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:426)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:440)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:629)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:670)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:496)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 22 more
BUILD FAILED (total time: 0 seconds)
This is my Jfx-impl.xml file
<target name="-check-jdk-version" depends="-do-init,-check-platform-home" unless="jdk-version-checked-in-jfximpl">
<local name="version-output"/>
<exec executable="${active.platform.home.java.executable}" outputproperty="version-output">
<arg value="-version"/>
</exec>
I could not find any solution in internet for the issue although there are many for the error code 193, not particularly related to java fx.
Can someone please tell me what could be causing the issue and how can I run this using a 64 bit JDK.
I am not sure what was the issue, but I resolved the issue with following steps:
Uninstalled JDK 64 Bit
Uninstalled JDK 32 Bit
Uninstalled Netbeans
Installed JDK 64 Bit
Installed Netbeans8.~
Imported the JavaFX project

How can I bundle the JAXB runtime libraries with OpenJDK 11?

Background:
In my organization there are a lot of Java based Windows desktop applications. In our proprietary software deployment system the applications don't contain an individual JRE / JDK. Rather a common JRE (so far Oracle 8 Java SE JRE) is deployed to the users machine, which is attached to the individual applications based on environment variables.
We would like to migrate the JRE from Oracle 8 Java SE JRE to OpenJDK 11 without having to modify the applications. From Java 8 to Java 11 various libraries got removed, e. g. JavaFX. Using the Java module system and the jlink tool, I can create my own proprietary JDK enhanced with OpenJFX:
jlink --module-path ..\mods;C:\Temp\javafx-jmods-11.0.2 --add-modules=ALL-MODULE-PATH,java.base,java.compiler,java.datatransfer,java.desktop,... --output C:\Temp\OpenJDK+OpenJFX
Applications, which need JavaFX can use this proprietary JDK without being changed.
When I try to apply the same method to the latest beta of JAXB, I get the following error:
jlink --module-path ..\mods;C:\Temp\jaxb-ri-2.4.0-b180830.0438\jaxb-ri\mod --add-modules=java.xml.bind,java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,... --output C:\Workspace\Java\OpenJDK_11.0.2_JFX_JAXB
Error: automatic module cannot be used with jlink: java.activation from file:///C:/Temp/jaxb-ri-2.4.0-b180830.0438/jaxb-ri/mod/javax.activation-api.jar
As per https://github.com/eclipse-ee4j/jaf/issues/13, "JAXB API uses activation-api as its dependency and is forced to use it as an automatic module or from classpath because of missing a module-info.java descriptor file."
Furtheron as per Is it possible to use jlink on JDK 11 to make a runtime including the Java SE EE modules that were removed? I can bundle the module java.xml.bind using jlink from Java 10, which still contained it. Indeed jlink succeeds, if I add two modules from OpenJDK 10.0.2 to the module path:
jlink --module-path ..\mods;C:\Temp\jdk-10.0.2\jmods\java.xml.bind.jmod;C:\Temp\jdk-10.0.2\jmods\java.activation.jmod --add-modules=java.xml.bind, ...
But when I run my application with the generated JDK, I get errors like this:
!ENTRY org.eclipse.osgi 4 0 2019-02-15 15:58:58.642
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
... 22 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 24 more
Or this:
Feb. 15, 2019 2:49:03 NACHM. com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector <clinit>
SEVERE: null
java.security.PrivilegedActionException: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector.<clinit>(Injector.java:182)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:66)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:164)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:270)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:53)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:73)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:85)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:47)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:499)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:316)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:124)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1141)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:150)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.xml.bind#10.0.2/javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:282)
at java.xml.bind#10.0.2/javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:271)
at java.xml.bind#10.0.2/javax.xml.bind.ContextFinder.find(ContextFinder.java:406)
at java.xml.bind#10.0.2/javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:706)
at java.xml.bind#10.0.2/javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:647)
at com.xxx.build.automation.utils.internal.CategoryFileHandler.unMarshalFile(CategoryFileHandler.java:17)
at com.xxx.build.automation.utils.common.GetComponentName.doExecuteInternal(GetComponentName.java:89)
at com.xxx.build.automation.utils.common.GetComponentName.execute(GetComponentName.java:72)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2109)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:186)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:182)
... 48 more
Question:
Is there any possibility, how I can bundle the JAXB libraries with OpenJDK 11?
Hint:
I am aware on approaches how to tackle the removed JAXB at build time for a classic Java application build: How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9 or Include JAXB using Maven. But if I don't want to touch the deployed application binaries, build time solution doesn't help me in this scenario.
Try to include these two dependencies:
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime'
If you are using javax API modules, it is usually not possible to upgrade from jdk8 without modifying you application. Some implementations like com.sun packages where physically removed since jdk9 and you have to add them as dependency.
You are also running into the java.lang.NoSuchMethodException so the current available implementation is not compatible anymore with the javax API from jdk10
My organization finally gave in to modify the applications at compile time. It is not the solution I was searching for, but at least it works for us.
JAXB has been removed from JDK starting with version 11, you would need to add it as you add all other dependencies.
Example for maven:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.api.version}</version>
</dependency>

griffon lazybones cannot create griffon-swing-groovy project

I am following this guide Griffon Guide 2.12
I am stuck at 2.2.1. Creating a Project in the line
$ lazybones create griffon-swing-groovy console
I get the following errors:
lazybones create griffon-swing-groovy console ~
Creating project from template griffon-swing-groovy (latest) in 'console'
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.configuredInputStream(ResourceGroovyMethods.java:1978)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.newInputStream(ResourceGroovyMethods.java:1991)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.withInputStream(ResourceGroovyMethods.java:1657)
at uk.co.cacoethes.lazybones.commands.PackageDownloader$_downloadPackage_closure1.doCall(PackageDownloader.groovy:33)
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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:292)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.Closure.call(Closure.java:423)
at groovy.lang.Closure.call(Closure.java:439)
at org.codehaus.groovy.runtime.IOGroovyMethods.withStream(IOGroovyMethods.java:1316)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.withOutputStream(ResourceGroovyMethods.java:1627)
at uk.co.cacoethes.lazybones.commands.PackageDownloader.downloadPackage(PackageDownloader.groovy:32)
at uk.co.cacoethes.lazybones.commands.PackageDownloader$downloadPackage.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:138)
at uk.co.cacoethes.lazybones.commands.CreateCommand.doExecute(CreateCommand.groovy:89)
at uk.co.cacoethes.lazybones.commands.AbstractCommand.execute(AbstractCommand.groovy:30)
at uk.co.cacoethes.lazybones.LazybonesMain.main(LazybonesMain.groovy:89)
I am using the following environment for developing
Windows 7 Ultimate
Babun shell
SDK version SDKMAN 5.5.12+269
Lazybones
lazybones list ~
Available templates in griffon/griffon-lazybones-templates
griffon-javafx-groovy
griffon-javafx-java
griffon-javafx-kotlin
griffon-lanterna-groovy
griffon-lanterna-java
griffon-pivot-groovy
griffon-pivot-java
griffon-plugin
griffon-swing-groovy
griffon-swing-java
Gradle
gradle -v
Gradle 4.3
Build time: 2017-10-30 15:43:29 UTC Revision:c684c202534c4138b51033b52d871939b8d38d72
Groovy:2.4.12
Ant:Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:1.8.0_144 (Oracle Corporation 25.144-b01)
OS:Windows 7 6.1 x86
I downloaded the templates manually also
The following are available in .lazybones/templates
griffon-javafx-groovy-template-1.9.1
griffon-javafx-java-template-1.9.1
griffon-plugin-template-1.9.1
griffon-swing-groovy-template-1.9.1
griffon-swing-java-template-1.9.1
I am still unable to create any project using lazybones.I am not able to understand the problem that I am getting.
Thanks in advance,
Vanlal
That's odd, I can successfully create an application using the latest versions of all tools, starting from scratch as witnessed by
[tmp]> ls -l ~/.lazybones/templates/
[tmp]> lazybones --version
Lazybones version 0.8.3
[tmp]> gradle --version
------------------------------------------------------------
Gradle 4.3
------------------------------------------------------------
Build time: 2017-10-30 15:43:29 UTC
Revision: c684c202534c4138b51033b52d871939b8d38d72
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_144 (Oracle Corporation 25.144-b01)
OS: Mac OS X 10.12.5 x86_64
[tmp]> lazybones create griffon-swing-groovy sample
Creating project from template griffon-swing-groovy (latest) in 'sample'
Define value for 'group' [org.example]:
... snip snip ...
Project created in sample!
[tmp]> ls -l ~/.lazybones/templates/
total 1024
-rw-r--r--+ 1 aalmiray staff 510K Oct 31 18:28 griffon-swing-groovy-1.12.0.zip
[tmp]>
It's worth mentioning that the latest version of the griffon-swing-groovy template is 1.12.0. You may specify a version number when creating the application, such as
lazybones create griffon-swing-groovy 1.12.0 sample

Ant: "IOException: Error writing request body to server" on deployment to tomcat

I am new to StackExchange so please bear with my eventual mistakes...
I have been searching for answers but none seem to apply to my situation being that that build and deployment actually works, but the result is though an IOException at the end of the deployment call.
I am making a build an deployment script in ant. The deployment part is using this taskdef:
<taskdef name="tomcatdeploy" classname="org.apache.catalina.ant.DeployTask" />
<target name="-tomcatdeploy" description="deploy to tomcat">
<echo>deploying from client</echo>
<tomcatdeploy
url="http://32.0.26.146:8080/manager/text"
username="<veryHardToGuessUsername>"
password="<veryHardToGuessPassword>"
path="/avlsweb"
war="/mnt/s/Web/Avlsweb/BambooBuilds/TEST/${nt-server.dir.test}_Tc${version}/avlsweb##${version}.war"
version="${version}"
/>
We use Bamboo as build server. This worked fine for a number of builds. However recently I got this build error:
/mnt/data/bamboo_home/xml-data/build-dir/AVTST-TEST15-JOB1/AvlswebScripts/Ant/build.xml:286: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3192)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3175)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:242)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:195)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(DefaultExecutor.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)
The strange thing is that the build works and it also deploys fine to tomcat. However, for some reason an IOException occurs after the deployment resulting in a "red" failed build message in Bamboo. A couple of additional remarks:
Tomcat manager-script user is setup
Bamboo build server with ant is running on the same server as the targeting tomcat applicationserver however bamboo and the targeting tomcat are running as separate servers on separate ports.
Build server: Atlassian Bamboo 5.9.0
Ant version: 1.9.2
Tomcat version: 8.0.15
Java version: 1.7.0_67
Any ideas?
i think i am slow, i have faced same problem
in tomcatdeploy task instead of war make it localWar
You will get this error if you already have an instance deployed to the Tomcat server. You can set update="true" in the tomcatdeploy:
<tomcatdeploy
url="http://32.0.26.146:8080/manager/text"
username="<veryHardToGuessUsername>"
password="<veryHardToGuessPassword>"
path="/avlsweb"
war="/mnt/s/Web/Avlsweb/BambooBuilds/TEST/${nt-server.dir.test}_Tc${version}/avlsweb##${version}.war"
version="${version}"
update="true"
/>
Another option is to explicitly undeploy and then redeploy, or use the reload tag instead of the deploy tag.

JavaFX8 - sun.util.logging.PlatformLogger not found Exception in NetBeans 8

I have recently installed JDK8 + Netbeans8 (downloaded the bundled setup from Oracle site) on my Windows 8.1 machine.
When I create a very simple JavaFX FXML application, it works fine. However when I add a new database entity class using the wizard and compile it, I get following stack trace:
Note: Creating non-static metadata factory ...
error: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for sun.util.logging.PlatformLogger not found
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.RuntimeException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for sun.util.logging.PlatformLogger not found
at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:407)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1173)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:859)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
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.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1153)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:145)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for sun.util.logging.PlatformLogger not found
C:\Users\AJQ\Documents\NetBeansProjects\JavaFX8App\nbproject\jfx-impl.xml:3438: The following error occurred while executing this line:
C:\Users\AJQ\Documents\NetBeansProjects\JavaFX8App\nbproject\build-impl.xml:924: The following error occurred while executing this line:
C:\Users\AJQ\Documents\NetBeansProjects\JavaFX8App\nbproject\build-impl.xml:264: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
However, if I comment out the annotations in the entity class or change the target platform from 1.8 to 1.7, application gets compiled without any issue.
Is it some bug in NetBeans 8 or some other configuration issue?
Right Click on the project and select "Properties".
Select "Libraries" from opened "Project Properties window".
Select "Processor" tab.
Remove EclipseLink from there.
Apply the changes and do a Clean Build.
That's it. :)
I have the same platform (netbeans 8.0 and JDK 8), searching in other project (build in netbeans 7.4 and JDK 7) I found a little difference in the project.properties file, search it in <>/nbproject, look for the line:
javac.processorpath=\
${javac.classpath}:\
${libs.eclipselinkmodelgen.classpath}
and change the text to finally be the following:
javac.processorpath=\
${javac.classpath}
thats all, I don't know if it's a bug in netbeans 8 or maybe it's something wrong in the way to make the project, but this fix work for me, more details in this blog entry (spanish version)
For Maven projects, setting the bootclasspath for the compiler plugin fixes the problem:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerArguments>
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
I got the same error, I checked what imolero said at the project.property file and is exactly as he said is the solution, so I have to change nothing in it.
I realized that each time I worked in a JavaFX project the java files are not compiled automatically when save the file, so I made manually (F9), and re-run the project and every thing works fine. I tried to set Compile on Save in the project properties, but is shadowed, that´s the reason that I have to do it manually. My enviroment is: Windows 7 Professional 64 bits, JDK 1.8.0, Netbeans 8.0 (Build 201403101706)

Categories