CHelper Codeforce/Topcoder plugin issue - java

I install the plugin CHelper for InelliJ IDEA (for MacOSX) and it doesn't work fine. I have a problem to compile a task problem, you can see the log in below.
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: /src/test/A - Maze.task (No such file or directory)
at net.egork.chelper.tester.NewTester.test(NewTester.java:41)
at net.egork.chelper.tester.NewTester.main(NewTester.java:23)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.io.FileNotFoundException: /src/test/A - Maze.task (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at net.egork.chelper.tester.NewTester.test(NewTester.java:39)
... 6 more
The Event Log : 20:12:53 Compilation completed successfully in 1 sec
My chelper.properties :
smartTesting=true
archiveDirectory=/src/archive
defaultDirectory=/src/test
extensionProposed=true
outputClass=java.io.PrintWriter
excludePackages=java.,javax.,com.sun.
outputDirectory=/src
author=
libraryMigrated=true
failOnIntegerOverflowForNewTasks=false
inputClass=java.util.Scanner
enableUnitTests=true
testDirectory=/src/test
Some Image to clarify my question/problem.
Can anyone help me to fix that issue in my config?
Thanks!

Check the output folder selected in your projects build path. Are these uncompiled files in your src folder in your build folder? I am betting they are not since most project builders will only copy over the compiled class files. If that is the case you will need to Google the Resource folder that Eclipse uses to copy them to instead.

Related

Exception in thread “main” java.util.zip.ZipException: error in opening zip file

I'm trying to create a web application in NetBeans 8.2, for this I try to use Apache Tomcat 8.0.27 which is integrated into this version. Previously I worked with Tomcat and Netbeans without any problem but in one occasion it failed.
I tried to modify environment variables in addition to reinstalling NetBeans with all its components but it did not work. I looked for information in other questions but I didn't find anything useful, possibly some file is corrupted but if it were the case, I would like to know how to solve it with a simple and understandable explanation, in some forums I read about how to find corrupted files and solve some things but they are not so clear to me.
Specs:
- Windows
- Netbeans 8.2
- Tomcat 8.0.27
- JDK & JDR 1.8.0.191
**Exception in thread "main" java.lang.InternalError:** java.util.zip.ZipException: error in opening zip file
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1052)
at sun.misc.URLClassPath.getResource(URLClassPath.java:249)
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.util.ResourceBundle$RBClassLoader.loadClass(ResourceBundle.java:512)
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2649)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1510)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1474)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1370)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:782)
at sun.security.provider.AuthPolicyFile$1.run(AuthPolicyFile.java:74)
at sun.security.provider.AuthPolicyFile$1.run(AuthPolicyFile.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.provider.AuthPolicyFile.<clinit>(AuthPolicyFile.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at javax.security.auth.Policy$2.run(Policy.java:236)
at javax.security.auth.Policy$2.run(Policy.java:228)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Policy.getPolicyNoCheck(Policy.java:227)
at javax.security.auth.Policy.getPolicy(Policy.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
at org.apache.catalina.startup.Catalina.load(Catalina.java:576)
at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
**Caused by: java.util.zip.ZipException: error in opening zip file**
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:940)
at sun.misc.URLClassPath$JarLoader.access$800(URLClassPath.java:801)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:886)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:879)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:878)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1050)
... 44 more
I would expect Tomcat to deploy without any problem but instead it is simply not deployed, sending the error every time.
Update: I installed the same NetBeans but in other computer AND it worked. I copyied the files of Tomcat and NetBeans but the error still (So, theres no a problem related to corrupted .jars i think). The project that im using to test it's a basic HTML page... A default Java web project.
This problem in most part of times is a Exception of corrupted jars.
Are you trying to connect to any database? If yes, try to remove .jar file from lib folder on WebContent and copy the file from your computer directory to your folder on IDE and try again. If no, try to do this procedure to all of .jars that you're using on your project and replace them all again.

Uiautomatorviewer SWT exception

Since StackExchange advised me to not ask for help or clarification on a previously existing post, I am making a new thread.
On Windows 10x64 I downloaded the Eclipse SWT (in second-to-last section of Downloads page), set my ANDROID_SWT environment variable to <download location>\swt.jar, and have attempted to run uiautomatorviewer from cmd again, only to receive the same error message as when I tried to use the SWT bundled with eclipse:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Listener
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Listener
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Has anyone else encountered this error, and if so, what was the root cause?
Thanks in advance for your time and help!
In my case adding ANDROID_SWT to environment variables or editing PATH didn't solve the problem. Therefore I found a different solution via help from this question.
Running uiautomatorviewer.bat and output :
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Control
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Listener
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
Solution :
Go to : https://www.findjar.com/ and search for missing class.
In this case search for class :
org.eclipse.swt.widgets.Control
For your case it is:
org.eclipse.swt.widgets.Listener
Names of the classes in the error can change, but all the classes needed comes from .jar file that will be downloaded.
In the results click :
[CLASS] org.eclipse.swt.widgets.Control
or for your case :
[CLASS] org.eclipse.swt.widgets.Listener
Download latest and suitable file for your OS. This was the latest and suitable for Windowsx86_64 currently.
Put downloaded .jar file into :
C:\Users\{userId}\AppData\Local\Android\Sdk\tools\lib
or equivalent path for your OS.
Now uiautomatorviewer.bat should run without any problems.
Make sure JDK location selected in Android studio is same as JDK set in environment variable.
In my case the exception was
Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/swt/custom/TableTreeItem
at org.eclipse.jface.util.OpenStrategy.initializeHandler(OpenStrategy.java:270)
at org.eclipse.jface.util.OpenStrategy.<init>(OpenStrategy.java:108)
at org.eclipse.jface.viewers.StructuredViewer.hookControl(StructuredViewer.java:1213)
at org.eclipse.jface.viewers.ColumnViewer.hookControl(ColumnViewer.java:68)
at org.eclipse.jface.viewers.AbstractTreeViewer.hookControl(AbstractTreeViewer.java:1452)
at org.eclipse.jface.viewers.TreeViewer.hookControl(TreeViewer.java:274)
at org.eclipse.jface.viewers.TreeViewer.<init>(TreeViewer.java:137)
at org.eclipse.jface.viewers.TreeViewer.<init>(TreeViewer.java:124)
at com.android.uiautomator.UiAutomatorView.<init>(UiAutomatorView.java:361)
at com.android.uiautomator.UiAutomatorViewer.createContents(UiAutomatorViewer.java:66)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.window.Window.open(Window.java:790)
at com.android.uiautomator.UiAutomatorViewer.main(UiAutomatorViewer.java:78)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.custom.TableTreeItem
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 13 more
Steps followed for the solution
Go to https://jar-download.com/
Search for the missing jar file in my case it was org.eclipse.swt.custom.tabletreeitem
Download the jar file compatible with your system Mac/Win/Linux (In my case it was mac
enter image description here
Extract the jar file and copy it
Go to the lib folder inside SDK (Android/Sdk/Tools/Lib
Paste the jar file into the lib folder
Restart your terminal or cmd
Run the command again for cd $ANDROID_HOME/tools/bin
Run the command ./uiautomatorviewer
Alternatively
Try to download the swt jar file with a different version and copy it to the respective folders.
Follow this thread :
https://github.com/android/android-test/issues/911#issuecomment-849389068
Precisely follow these instructions. I made the mistake of trying to download the Eclipse SWT in order to troubleshoot other issues I was having; setting this different SWT version in the CLASSPATH and ANDROID_SWT environment variables caused this exception.

Error with Ant build copying files, "Access is denied"

I have a weird bug that is popping up in my Ant build. The build works as such: build.xml calls a new buildTargets.xml file, and in that file most of the work is being done. buildTargets.xml creates a bunch of new files in gwt-out/htdocs/** and another directory staging/htdocs/**. Basically, files are being created in gwt-out/htdocs and then copied into staging/htdocs. The error is that only one file is not being copied, and I am getting a java.IO.FileNotFoundException (Access is denied) error. The weird part is that the file changes from build to build.
At first I thought it was an Eclipse problem so I built through the command line, and a new (a different file than eclipse) was not being put into staging/htdocs, which was yielded the same error. I've attached what Ant has said with the -debug flag. The error seems to pop up when the files are being tokenized in buildTargets.xml. After searching around it seems that the most common response was to fix my permissions-- however the file is being dynamically created, and when I go to check on that file all permissions are enabled (except "Special"), so I don't think that's the issue.
Other SO questions similar to mine all deal with building on a remote server and fixing my permissions to that server-- however this is all local to my computer, so I'm not sure that is the issue either. Could it be an error with the copying task in the Ant build?
Here's the error:
BUILD FAILED
C:\CSDK\build\buildTargets.xml:253: Failed to copy C:\Users\admin\worksp
ace\BuildPortal\out\gwt-out\htdocs\war\BuildPortalTest.iOS_Bu
ild_Portal\sc\modules\ISC_DataBinding.js to C:\Users\admin\workspace\BuildPortal
\out\staging\htdocs\war\BuildPortalTest.iOS_Build_Portal\sc\m
odules\ISC_DataBinding.js due to java.io.FileNotFoundException C:\Users\admin\wo
rkspace\BuildPortal\out\staging\htdocs\war\BuildPortalTest.iO
S_Build_Portal\sc\modules\ISC_DataBinding.js (Access is denied)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:907)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:563)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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.io.FileNotFoundException: C:\Users\admin\workspace\BuildPortal\o
ut\staging\htdocs\war\BuildPortalTest.iOS_Build_Portal\sc\mod
ules\ISC_DataBinding.js (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
Thanks.
I ended up using the retry task, and that seemed to work based off of Isaac's description of what was possibly going wrong.

Install and compile JacORB

I was following this tutorial to install JacORB Tutorial. In the last step, when I want to compile it, I got this error
Buildfile: /Users/adm/Downloads/jacorb/build.xml
base-init:
init-properties:
init-path:
init-javac-common:
init-javac-jdk:
init-javac-j2me:
init:
src-check:
BUILD FAILED
/Users/adm/Downloads/jacorb/build.xml:21: Unable to find src files. Is this a binary distribution?
But if I try ant in a demo file it builde successfully. I don't have to do the last step in the tutorial ? The second question is how to excute the build file ? after I builded the hello demo, I tried "jaco build" but I got a java exception
jaco build
Exception in thread "main" java.lang.NoClassDefFoundError: build
Caused by: java.lang.ClassNotFoundException: build
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
You likely have the binary distribution of JacORB.
Download the source distribution of JacORB instead. On the JacORB Download page, click the link for Full source code.
Or see https://github.com/JacORB/JacORB/ for the official source code.
I would recommend asking questions about JacORB on the jacorb-developer list (http://www.jacorb.org/contact.html)

can't build a ant target in TFS location

I have a ant target, xml file in my TFS project folder. the project folder is bound with TFS(Team Foundation Server). My problem is when ever i try to build the project by running the ant target in that TFS bound location it fails. it gives the following failure.
> ria_ant_build.xml:435: Error running C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe compiler
at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.
java:508)
at org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:61)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1153)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor7.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: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe": CreateProcess erro
r=87, The parameter is incorrect
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.
java:505)
... 19 more
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 24 more
but when i copy the project to a different location and remove the read only attribute from the folder the ant target runs without any error and I'm getting a deploy-able artifact. but even when i remove the read only attribute from the TFS folder i could not build the ant target.It seems like the problem exist on the TFS location it self. :(
can some one suggest me a method to solve this problem. I have to stay in the TFS location you guys know the reason i assume :)
--
Thanks & Regards,
Rangana
From your question it's hard to figure out what really causes your problem.
Perhabs, your ant call length is too long and even longer than the max command prompt line (that's 8191 characters in the latest versions of Windows). As question Fail to launch application (CreateProcess error=87), can't use shorten classpath workaround says you may consider "to shorten folder names, reduce depth of folder trees, using parameter files, etc".
Try to run ant with the -debug option to see the specific command-line parameters of your build call inside the TFS workspace. In that way you can estimate the total length of the call.

Categories

Resources