Error: NoClassDefFoundError When Using Eclipse To Run COMSOL Model - java

I am trying to use Eclipse to run a COMSOL model and I have read the guide from programming reference manual. However, Eclipse always report the error as follows,
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter at com.comsol.client.interfaces.b.(SourceFile:60) at com.comsol.client.interfaces.b.(SourceFile:39) at com.comsol.clientapi.engine.APIEngine$c.b(SourceFile:497) at com.comsol.clientapi.engine.APIEngine.a(SourceFile:115) at com.comsol.clientapi.engine.APIEngine.connect(SourceFile:98) at com.comsol.clientapi.engine.APIEngine.connect(SourceFile:87) at com.comsol.clientapi.engine.ClientModelUtil.connect(SourceFile:145) at com.comsol.clientapi.engine.ClientModelUtil.connect(SourceFile:133) at com.comsol.model.util.ModelUtil.connect(SourceFile:248) at PFCZM_3PBending_QuasiBrittle.main(PFCZM_3PBending_QuasiBrittle.java:16750) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ... 10 more
I believe I have imported the JAR files correctly and set the path for the project and it seems that the error is due to lack of source file for COMSOL API JAR files. I have checked those JAR file and found they are indeed all class files without definition. How can I solve this problem? Thanks!

Related

Exception in thread "main" java.lang.NoClassDefFoundError: com/talend/csv/CSVWriter when create Schema in Talend

Good day,
I am new to Talend, I am trying to create a Schema for tFileInputDelimited component. The Schema is trying to read a text file from a folder.
However, during step 3 on creating this Schema, I am hitting some class not found exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/talend/csv/CSVWriter
at orion_dl_track.shadowfileinputtodelimitedoutput_0_1.ShadowFileInputToDelimitedOutput.tFileInputDelimitedProcess(ShadowFileInputToDelimitedOutput.java:1709)
at orion_dl_track.shadowfileinputtodelimitedoutput_0_1.ShadowFileInputToDelimitedOutput.runJobInTOS(ShadowFileInputToDelimitedOutput.java:2436)
at orion_dl_track.shadowfileinputtodelimitedoutput_0_1.ShadowFileInputToDelimitedOutput.main(ShadowFileInputToDelimitedOutput.java:2295)
Caused by: java.lang.ClassNotFoundException: com.talend.csv.CSVWriter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 3 more
Preview error. Some settings must be changed.
Note: Preview errors are generally due to a wrong encoding setting.
org.talend.designer.runprocess.shadow.ShadowFilePreview.preview(ShadowFilePreview.java:90)
org.talend.metadata.managment.ui.utils.ShadowProcessHelper.getCsvArray(ShadowProcessHelper.java:383)
org.talend.repository.ui.wizards.metadata.connection.files.delimited.DelimitedFileStep2Form$PreviewProcessor.nonUIProcessInThread(DelimitedFileStep2Form.java:1309)
org.talend.commons.ui.swt.thread.SWTUIThreadProcessor$1.run(SWTUIThreadProcessor.java:74)
For java program, then I will know I need to import this library into my project, like adding the gradle implementation script from Maven website.
But how about this talend? Is it I need to go some where to download the jar and import into Talend Studio?

"No dependency satisfies type class org.neo4j.kernel.api.index.SchemaIndexProvider" when building über-jar

I have manually downloaded and added the libraries log4j, jsoup and neo4j for a project in Intellij Idea.
Before adding neo4j, I could build a jar as an artifact with all the libraries extracted to it so i could directly copy it somewhere and run with java -jar file.jar.
When I run the application in IntelliJ Idea it always works!
Now i get the following error when running the jar:
Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:314)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:268)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
at java.util.jar.JarFile.getInputStream(JarFile.java:450)
at sun.misc.JarIndex.getJarIndex(JarIndex.java:137)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:839)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:831)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:830)
at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:803)
at sun.misc.URLClassPath$3.run(URLClassPath.java:530)
at sun.misc.URLClassPath$3.run(URLClassPath.java:520)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:519)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:492)
at sun.misc.URLClassPath.getNextLoader(URLClassPath.java:457)
at sun.misc.URLClassPath.getResource(URLClassPath.java:211)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
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)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
I already searched for the error and found that a library seems to be signed and I can't just pack it into another jar, because it thinks it was modified then.
The suggested solution was to exclude the signing files through the build system.
I tried to manually delete the BCKEY.dsa and the BCKEY.sf files (only signing files in META-INF folder) in the resulting jar but then I get the following error:
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /home/xuiqzy/Documents/uni/4.Semester/PRG_practicum/WikiXtractor/data
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:144)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:40)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:100)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda$createDatabaseCreator$0(GraphDatabaseFactory.java:89)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:65)
at de.bened.wikixtractor.DatabaseManager.initialize(DatabaseManager.java:43)
at de.bened.wikixtractor.Main.main(Main.java:83)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource#5c67716' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:99)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:434)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:140)
... 8 more
Caused by: org.neo4j.kernel.impl.util.UnsatisfiedDependencyException: No dependency satisfies type class org.neo4j.kernel.api.index.SchemaIndexProvider
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:71)
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:67)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:418)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:434)
... 13 more
I also searched that error, a META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory file exists in my jar, there are also the jars lucene-analyzers-commen, lucene-codecs, lucene-core, lucene-queryparser, neo4j-lucene-index and neo4j-lucene-upgrade all integrated in the über-jar and the build in IntelliJ Idea seems to have enough dependencies, too.
So I'm a bit clueless why the jar doesn't work as opposed to the build in the IDE.
Long term I'm willing to switch to a build system but for now:
Is there a way to get the jar to run?
Any help or pointers in the right direction are appreciated! :)

Using one-jar to build one jar file

I'm trying to use one-jar to generate one jar file that contains clojure jar file and java class file: Creating one jar file that for execution from Java/Clojure
Following the instruction, I could generate directories using one-jar-appgen-0.97.jar. As instructed, I replaced the java source, and added the ThingOne-1.0.0-SNAPSHOT-standalone.jar
Running ant, it builds jar file without an error, but I got error messages when I try to execute the jar file.
java -jar build/test-one-jar.jar
test_one_jar main entry point, args=[]
Hello from Java!
Exception in thread "main" java.lang.reflect.InvocationTargetException
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.simontuffs.onejar.Boot.run(Boot.java:342)
at com.simontuffs.onejar.Boot.main(Boot.java:168)
Caused by: java.lang.ExceptionInInitializerError
at clojure.lang.Namespace.<init>(Namespace.java:34)
at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
at clojure.lang.Var.internPrivate(Var.java:149)
at ThingOne.core.<clinit>(Unknown Source)
at onejar.main.TestOneJarMain.run(TestOneJarMain.java:27)
at onejar.main.TestOneJarMain.main(TestOneJarMain.java:20)
... 6 more
Caused by: java.lang.NullPointerException
at clojure.lang.RT.lastModified(RT.java:374)
at clojure.lang.RT.load(RT.java:408)
at clojure.lang.RT.load(RT.java:398)
at clojure.lang.RT.doInit(RT.java:434)
at clojure.lang.RT.<clinit>(RT.java:316)
... 12 more
What might be wrong?
Lines 168 and 342 in the Boot.java class of One-Jar indicate a problem with setting properties. This problem is happening when unit tests fail. My guess is it's related to bug 3090800 in the SourceForge One-Jar Bug Tracker.

Jars in my grails project not being picked up when deployed to tomcat 5.5

I am running a grails test run-app all day with my application and it is fine. I type "grails prod war" to get a war, and dump it in the webapps folder of my tomcat install. Now i get the message like so:
11.11.2010 16:35:11 *ERROR* GrailsExceptionResolver: Executing action [index] of controller [ResumeController] caused e
xception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context (GrailsExceptionResolver.ja
va, line 72)
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [index] of controll
er [ResumeController] caused exception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Cont
ext
at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382)
at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180)
at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize
class org.docx4j.jaxb.Context
... 3 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:599)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:199)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:188)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:188)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:169)
at com.iai.skillsdb.DocxHelpers.DocxParser.openDocx4j(DocxParser.java:70)
at ResumeController$_closure8.doCall(ResumeController.groovy:164)
at ResumeController$_closure8.doCall(ResumeController.groovy)
at ResumeController.invokeMethod(ResumeController.groovy)
at ResumeController$_closure1.doCall(ResumeController.groovy:41)
at ResumeController$_closure1.doCall(ResumeController.groovy)
... 3 more
What is causing this? I have the docx4j jar in my WAR for sure, and it is there in the web-inf lib folder as well.
You're getting a java.lang.NoClassDefFoundError, not a java.lang.ClassNotFoundException. The class is being loaded, but a class that it depends on (directly or indirectly via another class) isn't there. You're most likely missing a jar that docx4j requires as a dependency.
Make sure that you have the correct version of docx4j and that there is absolutely no other version of docx4j in your classpath, there may be a version of this lib that did not have the 'Content' class implemented.

Exception in thread "main" org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser

I've created a stand-alone web services client in Java. I'm able to generate the WSDL properly but when when i execute my run.bat file, I get the exception above long with the exception below. I googled for the exception shown in the title and found a .jar file that contained it. I added this to my JBOSS_HOME/lib directory as well as the Client/lib directory. not sure why i'm still seeing this. ANY advice would be greatly appreciated.
Exception in thread "main" org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
at org.jboss.ws.metadata.config.JBossWSConfigFactory.parse(JBossWSConfigFactory.java:76)
at org.jboss.ws.metadata.config.JBossWSConfigFactory.getConfig(JBossWSConfigFactory.java:149)
at org.jboss.ws.metadata.umdm.EndpointMetaData.initEndpointConfigMetaData(EndpointMetaData.java:872)
at org.jboss.ws.metadata.umdm.EndpointMetaData.initEndpointConfig(EndpointMetaData.java:849)
at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDataBuilder.java:292)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:267)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:198)
at javax.xml.ws.Service.getPort(Service.java:141)
at com.firstcoverage.ws.client.om.WSStandAloneReportingSoapServiceService.getWSStandAloneReportingSoapServicePort(WSStandAloneReportingSoapServiceService.java:68)
at com.firstcoverage.ws.client.StandAloneReportingSoapClientFactory.ConnectToFCStandAloneReportingSoapWS(StandAloneReportingSoapClientFactory.java:70)
at com.firstcoverage.ws.client.StandAloneReportingSoapClientFactory.CreateInstance(StandAloneReportingSoapClientFactory.java:35)
at com.firstcoverage.ws.client.Reporter.main(Reporter.java:89)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:96)
at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:55)
at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
... 12 more
Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
... 14 more
Looks like i had too many jar files. removed the local jar files referencing xerces and i was cool
ref: http://community.jboss.org/wiki/whydoigetjavalangclasscastexceptionorgapachexercesparsersxincludeawareparserconfigurationinas-5
It could be not exact the same thing from the above link of the jobss site.
You might try to get your application using JAXB, JAXB-impl library from sun.
Here it forced to use org.jboss.xb.binding.

Categories