Signing jar created with onejar-maven-plugin throwing stackoverflow exception - stack-overflow

I have a jar which is created using onejar-maven-plugin, which is meant to listen to jms messages from tibco and process accordingly. It works fine but when I sign this jar using jarsigner and try to run it, it throws the exception below:
org.apache.commons.logging.LogConfigurationException: java.lang.StackOverflowError (Caused by java.lang.StackOverflowError)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:538)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:160)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:89)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:59)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.adobe.jobcloud.envoy.client.PushToPrereleaseWorker.main(PushToPrereleaseWorker.java: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 com.simontuffs.onejar.Boot.run(Boot.java:340)
at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.StackOverflowError
at com.simontuffs.onejar.OneJarFile.getJarEntry(OneJarFile.java:43)
at java.util.jar.JarFile.getManEntry(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at java.util.jar.JarFile.maybeInstantiateVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at com.simontuffs.onejar.OneJarFile.getJarEntry(OneJarFile.java:50)
at java.util.jar.JarFile.getManEntry(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at java.util.jar.JarFile.maybeInstantiateVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at com.simontuffs.onejar.OneJarFile.getJarEntry(OneJarFile.java:50)
at java.util.jar.JarFile.getManEntry(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
Also if I use maven-jarsigner-plugin to sign it, the result is exactly same. I'm clueless and stuck up with this issue.
Any help will be appreciated.

Have you tried to increase the -Xss JVM option? To 4096k at first, then lower it until it fails again.
Working with ciphers generally maybe need more than default stack size.
For the maven jarsigner plugin you can edit .mavenrc file in your linux home directory and add these lines:
#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-6-sun-i586 #(or another)
export M2_HOME=/usr/local/lib/apache-maven/apache-maven-3.0.4
export MAVEN_OPTS="-Xss4096k -XX:MaxPermSize=128m -Xmx384m"
I don't know how to do this under windows, but there must be similar solution (here?)

Related

why I am getting java.lang.ClassNotFoundException:com.google.api.client.json.JsonFactory when running on OSGi framework

I am new to OSGi and I made a method which will call the Google translate API. When I called that method in a main it is working fine. And also I used Eclipse for coding and exported the project into a jar file from Eclipse and installed it on the apache felix framework. When I start the bundle I get the following exceptions,
I added all the external jar files to build path also.
org.osgi.framework.BundleException: Activator start error in bundle EnglishToSinhalaServicePublisher [58].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2452)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.gogo.command.Basic.start(Basic.java:739)
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.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:139)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/google/api/client/json/JsonFactory
at englishtosinhalaservicepublisher.Activator.start(Activator.java:46)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
... 19 more
Caused by: java.lang.ClassNotFoundException: com.google.api.client.json.JsonFactory not found by EnglishToSinhalaServicePublisher [58]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1597)
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 22 more
java.lang.NoClassDefFoundError: com/google/api/client/json/JsonFactory
g!

Eclipse Plugin java.lang.NoClassDefFoundError

Hello I have problem with my plugin application with Java 8.
I am getting this output:
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.osgi.internal.messages.Msg
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:249)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.WebStartMain.basicRun(WebStartMain.java:79)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.WebStartMain.main(WebStartMain.java:57)
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 com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Required OSGI plugin is attached. I see this class in package but My application can't see It in runtime. I have tried to manipulate with MANIFEST of my project but without success. Do You have any ideas What could be the reason of this error?
Probably important info is that Application is launching via Eclipse Neon 3 but when I am trying to run It via commandline javaws It fails.

Error in reading a file from a remote server in SOAPUI 4.5.1 on Windows 7

I setup sOAPUI 4.5.1 on Windows XP. It read data file (Excel Format) from a remote server in Data Source correctly.
Now I change Windows to 7 and setup sOAPUI 4.5.1. But I have problem in reading file from remote server and exist Error az below:
"
http:\shpnt07\Support\Modernbank%20Maintenance\Shared%20Documents\محصولات%20مدرن\General\Test\Test%20Design\Functional%20Test\Test%20Data\R292\Loan\GetGuarantyList.xls (The filename, directory name, or volume label syntax is incorrect)
"
While the URL work correctly in Browser.
I try this with Disable and Enable Proxy in browser and SOAPUI.
also I try this with off Firewall and Antivirus.
When Run SoapUI the Error occur on soapui-error.log file:
2014-03-18 10:26:27,844 ERROR [errorlog] Network Error for Version Update or Proxy
2014-03-18 10:26:27,846 ERROR [errorlog] java.net.ConnectException: Connection timed out: connect
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.eviware.soapui.support.SoapUIVersionUpdate.getLatestVersionAvailable(SoapUIVersionUpdate.java:97)
at com.eviware.soapui.support.SoapUIVersionUpdate.checkForNewVersion(SoapUIVersionUpdate.java:267)
at com.eviware.soapui.SoapUIPro$SoapUIProRunner.run(SourceFile:1805)
at com.eviware.soapui.SoapUIPro.main(SourceFile:288)
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 com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
please Help me. This is important and I wait.
The error trace says it is having problem reaching out to soapUI server to look for the latest version of the soapUI. This could be of a proxy between you and the server.
You have two options to resolve this
Add proxy details
disable check for new version of soapUI. check the image below and leave the option unchecked.
For the excel file error can you change the محصولات%20مدرن folder name to an english name. Maybe it is not able to recognize the special characters. Also, when you give the url in soapUI are you removing %20 part?

Runnable JAR file error: Unsupported major.minor version 51.0

I made an application in Java (version 7) with Eclipse (Indigo) when I exported my application interface on a Runnable JAR file on my computer and tried it worked fine, then I tried on another computer and I get this problem
Exception in thread "main" java.lang.UnsupportedClassVersionError: cliente/Princ
ipal : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)
I saw other post that this can be because the other computer have an older version of Java than mine, can somebody confirm this please?.
Yes, that is the error when you try to run Java bytecode with an older version that the version you build it with.
You will find more information in this question.

AccessControlException when opening Tomcat 7's admin console

when iam just opening the admin console of tomcat 7.0 by this url, iam getting below exception
http://localhost:8085/
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.org.apache.jasper")
java.security.AccessControlContext.checkPermission(Unknown Source)
java.security.AccessController.checkPermission(Unknown Source)
java.lang.SecurityManager.checkPermission(Unknown Source)
java.lang.SecurityManager.checkPackageAccess(Unknown Source)
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
org.apache.jasper.servlet.JspServletWrapper.<init>(JspServletWrapper.java:120)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Unknown Source)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)
Please can anyone suggest how to resolve the above issue.
Don't run with a security manager or restore the default set of permissions ($CATALINA_BASE/conf/catalina.policy in a standard install). A default Tomcat install will work wth or without a security manager.
Change the permissions to your webapp in the file /etc/tomcat6/policy.d/04webapps.policy
Add this->
grant codeBase "file:${catalina.base}/webapps/<name of your webapp>/-" {
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.security.AllPermission;
};
It worked for me. Hope it helps!

Resources