How to find maven dependency jar files that are signed? - file

I met an error:
Exception in thread "main" java.lang.SecurityException: Invalid
signature file digest for Manifest main attributes.
This problem has been solved with this tip:
http://zhentao-li.blogspot.tw/2012/06/maven-shade-plugin-invalid-signature.html
So, how can I find which jar file is signed?

Well, I have found solutions.
This question is similar to the one below:
How can I tell which signed jar is causing maven-shade-plugin to fail?
In my case, bouncy castle is imported with activemq-all.
dependency

Related

Flink Error: java.lang.ClassNotFoundException: org.apache.flink.shaded.calcite.com.google.common.base.Throwables

I am using Flink for streaming the data which is in the csv file. I want to put it into table format with certain schema. For this purpose I am using Flink-table_2.10-1.1.3.jar (Table api) but I got the errors:
log4j:WARN No appenders could be found for logger (org.apache.flink.api.java.typeutils.TypeExtractor).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flink/shaded/calcite/com/google/common/base/Throwables
at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.create(JaninoRelMetadataProvider.java:450)
at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.revise(JaninoRelMetadataProvider.java:460)
at org.apache.calcite.rel.metadata.RelMetadataQuery.revise(RelMetadataQuery.java:186)
at org.apache.calcite.rel.metadata.RelMetadataQuery.collations(RelMetadataQuery.java:484)
at org.apache.calcite.rel.metadata.RelMdCollation.project(RelMdCollation.java:207)
at org.apache.calcite.rel.logical.LogicalProject$1.get(LogicalProject.java:122)
at org.apache.calcite.rel.logical.LogicalProject$1.get(LogicalProject.java:120)
at org.apache.calcite.plan.RelTraitSet.replaceIfs(RelTraitSet.java:238)
at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:116)
at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:108)
at org.apache.flink.api.table.plan.logical.Project.construct(operators.scala:90)
at org.apache.flink.api.table.plan.logical.Project.construct(operators.scala:85)
at org.apache.flink.api.table.plan.logical.LogicalNode.toRelNode(LogicalNode.scala:78)
at org.apache.flink.api.table.Table.getRelNode(table.scala:66)
at org.apache.flink.api.table.StreamTableEnvironment.translate(StreamTableEnvironment.scala:243)
at org.apache.flink.api.java.table.StreamTableEnvironment.toDataStream(StreamTableEnvironment.scala:147)
at table_streaming_test.main(table_streaming_test.java:90)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.shaded.calcite.com.google.common.base.Throwables
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
When I explore the corresponding jar, the respective class is present there. Can you please tell that why this is happening?
Also can I get the maven source so that I can build the Flink-table .jar at my place?
I had the same problem with CEP library. I added to my pom file but I kept getting ClassNotFoundException. I even packaged it with my jar file via IntelliJ but didn't work.
If you're using their flink-quickstart archetype, I think there are some other things to change in pom file to make it work. When I created a clean project and added flink dependencies myself, I didn't get that exception anymore. You can try and see if this approach works.
You can also add flink-table JAR file to lib folder in Flink. this also fixed my problem with CEP library. the JAR file is available in Maven repository website. download the version you want.
According to the Table and SQL document on Flink website:
Note: The Table API is currently not part of the binary distribution.
See linking with it for cluster execution here.
I was also facing the same problem with Table api in flink v1.4.2.
I added flink-table_2.11-1.4.2.jar file present in opt folder to the lib folder and restarted flink.
This works for me. Hopefully works for you too :)

Java Appengine SDK 1.9.6 Method not found

I have been having a terrible time figuring out a method not found problem. I've found similar questions on the appengine google group but none of the answers have helped solve the problem. Running my war locally with the dev server works fine but when I deploy my app I get the error below. I've included the top of the exception, the top of the last caused by and a list of the jars in my war's lib folder.
Here is the top part of the exception. I put each agurment on it's own line to make it easier to read
java.lang.NoSuchMethodError: com.google.appengine.api.datastore.Key.<init>(
Ljava/lang/String;
Lcom/google/appengine/api/datastore/Key;
Ljava/lang/String;
Lcom/google/appengine/api/datastore/AppIdNamespace;)V
Here is the top of the last caused by.
Caused by: java.lang.NoSuchMethodError: com.google.appengine.api.datastore.Key.<init>(
Ljava/lang/String
;Lcom/google/appengine/api/datastore/Key;
Ljava/lang/String;
Lcom/google/appengine/api/datastore/AppIdNamespace;)V
at com.google.appengine.api.datastore.KeyFactory.createKey(KeyFactory.java:84)
at com.google.appengine.api.datastore.KeyFactory.createKey(KeyFactory.java:77)
at com.googlecode.objectify.Key.<init>(Key.java:97)
Here is a listing of the jars in my war's WEB-INF/lib folder.
aopalliance-1.0.jar
appengine-api-1.0-sdk-1.9.6.jar
appengine-api-labs-1.9.6.jar
appengine-jsr107cache-1.9.6.jar
asm-3.1.jar
cglib-2.2.1-v20090111.jar
client-only-0.1.jar
datanucleus-appengine-1.0.10.final.jar
datanucleus-core-1.1.5.jar
datanucleus-jpa-1.1.5.jar
geronimo-jpa_3.0_spec-1.1.1.jar
geronimo-jta_1.1_spec-1.1.1.jar
gin-1.5.0.jar
guava-15.0.jar
guava-gwt-15.0.jar
guice-3.0.jar
guice-assistedinject-3.0.jar
guice-multibindings-3.0.jar
guice-servlet-3.0.jar
gwt-servlet.jar
hibernate-validator-4.1.0.Final-sources.jar
hibernate-validator-4.1.0.Final.jar
hibernate-validator-annotation-processor-4.1.0.Final.jar
javax.inject-1.jar
jdo2-api-2.3-eb.jar
jsr107cache-1.1.jar
jsr173-1.0.jar
jsr305-1.3.9.jar
jta-1.1.jar
libservice.jar
log4j-over-slf4j-1.6.1.jar
mgwt-1.2.0-rc-opera-removed.jar
objectify-5.0.2.jar
persistence-api-1.0.jar
server-and-client-0.1.jar
server-only.jar
slf4j-api-1.7.2.jar
uadetector-core-0.9.2.jar
uadetector-resources-2013.02.jar
validation-api-1.0.0.GA-sources.jar
validation-api-1.0.0.GA.jar
This was happening because of a quirk of gradle and javac with a little help from GWT and Objectify.
Since ~version 4.1, Objectify has had a separate jar with some appengine java sources in it so that Objectify classes can be used in the browser via GWT.
By default, sources included in compile dependencies in gradle will included in the compile output of the compile task. This is because gradle does not use the sourcepath parameter to the java compiler and according to Oracle's javac documentation:
If the -sourcepath option is not specified, the user class path is
also searched for source files.
I fixed the problem by adding this to my gradle file
compileJava.options.compilerArgs += "-sourcepath"
compileJava.options.compilerArgs += ""

Error while creating web service using apache CXF wizard

I am creating a web service through the apache CXF. but while i proceed(before the wsdl gets created), i receive the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cxf/tools/java2wsdl/JavaToWSDL
This seems like the java2ws.bat file has some error.
The statement in the bat file is
"%JAVA_HOME%\bin\java" -Djava.endorsed.dirs="%CXF_HOME%\lib\endorsed" -cp "%CXF_JAR%;%TOOLS_JAR%;%CLASSPATH%" -Djava.util.logging.config.file="%CXF_HOME%\etc\logging.properties" org.apache.cxf.tools.java2ws.JavaToWS %*
It seems like at Run time,jvm is not able to find the CXF.jar.I added it in the classpath but still the same error
please help me to solve the issue
The problem arises while creating JVM. You can refer : Java Refuses to Start - Could not reserve enough space for object heap
It solved my problem.

org.apache.jasper.JasperException: java.lang.IllegalStateException: No Java compiler available

I have Tomcat 6 when I getting start my server error context start form
SEVERE: Exception processing JAR at resource path /usr/share/java/jakarta-commons-pool-1.3.jar in context
java.util.zip.ZipException: error in opening zip file
When I request to any site it displays an error
org.apache.jasper.JasperException: java.lang.IllegalStateException: No Java compiler available
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
com.wvmagic.rf.filter.NoCacheFilter.doFilter(NoCacheFilter.java:73)
root cause
java.lang.IllegalStateException: No Java compiler available
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:229)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:581)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
com.wvmagic.rf.filter.NoCacheFilter.doFilter(NoCacheFilter.java:73)
I have tried lot, but cannot resolve the issue.
Please check this file: jasper-jdt.jar. If it doesn't exist in your /lib directory, than you should get one.
Probably means exactly what it says, you don't have a Java compiler. You need to install a SDK so that it can compile JSPs . Check for Java SDK and don't forget to set JAVA_HOME .
See this discussion for troubleshooting your problem.

java.lang.IllegalArgumentException thrown at debug launch in Eclipse CDT

I am using Eclipse CDT, with MinGW and under Windows XP, to developp a little C program exporting itself as a JNI-compliant DLL.
Debugging the program from the Java calls is not easy, and thus I added a "Debug" configuration to my project and a main method that tests some functions.
When I launch the debug, i get this weird Java error :
An internal error occurred during: "Launching NuanceWrapper.exe".
java.lang.IllegalArgumentException
It seems very much like it is an internal Eclipse problem. I got the stacktrace of the exception in the .log file of the .metadata folder :
!ENTRY org.eclipse.core.jobs 4 2 2011-02-04 14:08:31.531
!MESSAGE An internal error occurred during: "Launching Wrapper.exe".
!STACK 0
java.lang.IllegalArgumentException
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.getBundles(PackageAdminImpl.java:571)
at org.eclipse.core.internal.runtime.InternalPlatform.getBundle(InternalPlatform.java:181)
at org.eclipse.core.runtime.Platform.getBundle(Platform.java:1416)
at org.springframework.ide.eclipse.core.BundleStateLocationVariableResolver.resolveValue(BundleStateLocationVariableResolver.java:32)
at org.eclipse.core.internal.variables.DynamicVariable.getValue(DynamicVariable.java:54)
at org.eclipse.cdt.internal.core.cdtvariables.EclipseVariablesVariableSupplier$EclipseVarMacro.loadValue(EclipseVariablesVariableSupplier.java:103)
at org.eclipse.cdt.internal.core.cdtvariables.EclipseVariablesVariableSupplier$EclipseVarMacro.getStringValue(EclipseVariablesVariableSupplier.java:90)
at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getLaunchEnvironment(LaunchUtils.java:385)
at org.eclipse.cdt.dsf.gdb.launching.LaunchUtils.getGDBVersion(LaunchUtils.java:281)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.getGDBVersion(GdbLaunchDelegate.java:243)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:129)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:83)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:72)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Any idea what could be the problem ? I really need this debug functionality in order to understand what is wrong in my code.
Thank you for your answers.
I looked at the source code of the different files of your stack trace, and it seems to be a problem with your CDT project's configuration. You should check the settings here and try to change them.
One of the CDT build variables seems to be wrong. In LaunchUtils.java, line 390, var.getStringValue() is causing the issue because in this variable (var), which contains a name and an associated value, the value is null.
Hope this helps.
Had the same problem. the next string from the exception stack trace:
at org.springframework.ide.eclipse.core.BundleStateLocationVariableResolver.resolveValue(BundleStateLocationVariableResolver.java:32)
led me to the idea that SpringSource ToolSuite (or Spring IDE) could cause the issue. After uninstalling it and all its components the problem was gone.
Hope this helps.

Resources