i'm facing problem with following exception.anyone help me how to get rid of it.i have added axis.jar in classpath still facing this issue.
j
ava.lang.NoClassDefFoundError: Could not initialize class org.apache.axis.client.AxisClient
org.apache.axis.client.Service.getAxisClient(Service.java:104)
org.apache.axis.client.Service.<init>(Service.java:113)
com.netsuite.webservices.platform_2013_2.NetSuiteServiceLocator.<init>(NetSuiteServiceLocator.java:12)
com.zyom.netsuite.NetsuiteIntegrationManager.<init>(NetsuiteIntegrationManager.java:169)
com.zyom.netsuite.NetsuiteIntegrationManager.getNetSuiteIntegrationManager(NetsuiteIntegrationManager.java:68)
com.zyom.netsuite.controller.NetsuiteIntegrationManagerContoller.execute(NetsuiteIntegrationManagerContoller.java:33)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
com.zyom.security.LoginMonitorFilter.doFilter(LoginMonitorFilter.java:67)
You're probably missing some dependant library. In Eclipse you can look inside the jar file from project explorer and verify that there is a package 'org.apache.axis.client' and it contains class AxisClient.
(If you're not in Eclipse then otherwise you can just unpack your jar and see that the class is there - many possibilities for that, you can even rename the jar into zip and unpack it).
If the class file is in place, you're still missing it from classpath.
You would need to add commons-logging and commons discovery dependency jar in the library folder
Related
I cloned Amazon's ASK java repository on github and ran
mvn package
on it, and it produced the following .jars:
ask-sdk-core-2.3.4.jar
ask-sdk-apache-client-2.3.4.jar
ask-sdk-dynamodb-persistence-adapter-2.3.4.jar
ask-sdk-lambda-support-2.3.4.jar
ask-sdk-servlet-support-2.3.4.jar
ask-sdk-2.3.4.jar
I noticed that when attempting to make certain imports for classes on https://developer.amazon.com/docs/custom-skills, such as import com.amazon.speech.speechlet.servlet.SpeechServlet;
I received a message stating that com.amazon.speech could not be resolved, indicating that the file didn't exist. However, after further investigation, I noticed that there was a SkillServlet class that seemed to essentially replace the SpeechServlet class as it was able to do everything that SpeechServlet could,
so I assumed that the developer site hadn't been updated yet to reflect the changes. I then noticed that RequestHandler, a class in the repository, had a method that returned an object of type Optional< Response >. When I tried to import Response with the following import:
import com.amazon.ask.model.Response;
I recieved an error message stating The type com.amazon.ask.model.Response cannot be resolved. It is indirectly referenced from required .class files
This suggests that the class definition doesn't exist in the project's classpath, despite having included all of the above .jars. I searched through and was unable to find a model directory. Did my maven build fail, and am I missing any .jars? I'm using Eclipse EE IDE, which I know is susceptible to errors, but I've cleaned my project as well as restarted the IDE to no avail.
Update:
I noticed that the pom.xml file within the ask-sdk-core-2.3.4 directory contained a dependency for ASK SDK Model, but it doesn't seem to be obtaining the dependency. I also noticed that though ask-sdk-2.3.4 should also include everything that ask-sdk-core-2.3.4 does, as the latter is listed as a dependency in the former, I have to include ask-sdk-core's jar file separately or Eclipse is not able to recognize certain classes. I think this means that maven has failed, so I just downloaded the jar directly from mvnrepository.com. Any idea why this might have happened?
If you use ask-sdk-2.3.4.jar, then it should include all the dependencies you need like you noticed in your update blurb. When you look at Hello World sample in their Github repo, the pom.xml only contains ask-sdk-2.3.4.jar but not other dependencies that ask-sdk-2.3.4.jar has in it. https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/2.0.x/samples/helloworld/pom.xml
To your error message on Response, that is because you are missing ask-sdk-model jar which you can find from maven central. http://central.maven.org/maven2/com/amazon/alexa/ask-sdk-model/
I would suggest using maven and pom.xml so that you don't have to download jars individually.
Currently I'm trying to implement the code given in the answer to this question:
CTSheetView view = sheet.getCTWorksheet().getSheetViews().getSheetViewArray(0);
view.setView(STSheetViewType.PAGE_LAYOUT);
but the poi-ooxml-schemas (version 3.14) JAR file does not contain the class STSheetViewType. I delved into the poi-ooxml-schemas JAR file (using 7ZIP) and found that the class file STSheetViewType$Enum.class existed within the path:
org.openxmlformats.schemas.spreadsheetml.x2006.main.STSheetViewType$Enum.class
But (If I'm not mistaken) The '$' signifies an inner/nested class, meaning the STSheetViewType Enum is encapsulated within another class. I checked the documentation on the STSheetViewType class in an older version of poi-ooxml-schemas (version 1.1) here and found that the class STSheetViewType contained an inner Enum STSheetViewType.Enum.
This also seems to be confirmed by the errors I'm receiving from within Eclipse. I get these errors when using the code shown above:
"STSheetViewType cannot be resolved to a variable"
"The type org.openxmlformats.schemas.spreadsheetml.x2006.main.STSheetViewType cannot be resolved. It is indirectly referenced from required .class files"
Which further makes me believe that the STSheetViewType.Enum is missing its parent STSheetViewType class file. But why? I checked the documentation on the new version of poi-ooxml-schemas-3.14 and found no mention of STSheetViewType in the changelogs. I've downloaded the binary zip file for POI several times to ensure that my download wasn't faulty, I even downloaded the source and tried building the JARs but the class file is missing each time.
I found that a class STSheetViewType with seemingly the same functionality is held in another Jar file here but I can't seem to import the class correctly. Is such a thing even possible? Or must the class file come with the poi-ooxml-schemas-3.14 JAR file?
Ultimately I'd like to find out how to make the above code compatible with the current version of poi-ooxml-schemas-3.14 JAR. Any information or insight shed on that would be greatly appreciated.
As pointed out by #AxelRichter and the FAQ, Apache POI 3.14 and above uses a subset of classes from the ooxml-schemas-1.3.jar. You need to get that jar file and include in your classpath instead of poi-ooxml-schemas-3.14.jar. POI only provides the ooxml schemas classes it requires. When you begin to directly call ooxml schema classes in your own code, you most likely have to get the full jar that has all ooxml schemas classes to avoid this kind of issue you have. You can get the jar from maven central:
http://central.maven.org/maven2/org/apache/poi/ooxml-schemas/1.3/
See also the FAQ entry at http://poi.apache.org/faq.html#faq-N10025
I'm currently getting this error:
java.lang.NoSuchMethodError: org.json.JSONObject.keySet()Ljava/util/Set;
at ee.ut.cs.Parser.accessLint(Parser.java:39)
I have tried cleaning the project to no awail.
I suspect I have an error in the src/plugin/parse-htmlraw/build.xml while creating the jar file but I'm not certain. I understand that this error is because the function does not exist at runtime, but the object is created which means that the class is there, just not that function. I decompiled the .class file in created jar and it has the necessary functions.
Code is available at https://github.com/jaansusi/WCAGgrader
Q: What is wrong with the build that produces this error?
The problem is that even if I put the necessary class files in the jar I create, they are not linked correctly and the class that's called in the jar can't locate functions inside the other classes. The class object JSONObject is created but the functions inside the JSONObject class can't be found.
If you do not find the problematic version, there is a possibility you get it (especially if you are using Spring) from the following dependency -
<artifactId>android-json</artifactId>
<groupId>com.vaadin.external.google</groupId>
excluding it worked for me,
An easy way of analyzing dependencies is the maven-helper plugin in Intellij, see here
Check for the version you have used.
There might be a case where 2 different versions are being used which in turn causes this error.
To their own maven local repository com\Google\code\gson\gson, see if there are two or more version about json, will have to do is to delete the old, and remember to look at any other place in the project is introduced into the old version of the dependence, if any, change the old version of the dependence to the new version is perfectly solved this problem
I'm trying to use Jackson for converting string to JSON object in java. I have both jar file and maven project of the library, with which I tried one by one but both giving error while calling writeValue function. Error says -
The type com.fasterxml.jackson.core.JsonGenerator cannot be resolved. It is indirectly referenced from required .class files
I have correctly added the library to build path.
After looking at eclipse-error-indirectly-referenced-from-required-class-files ,I realized that the problem is because of missing com.fasterxml.jackson.core.JsonGenerator class file.So Which jar file I missed to add to build path?. Tried by adding the maven project on build path too- same error.
To find which jar contains the required file, you can always use http://search.maven.org and search for the class prefixing it with fc:, like this:
http://search.maven.org/#search%7Cga%7C1%7Cfc%3Acom.fasterxml.jackson.core.JsonGenerator
Looks like you're missing jackson-core jar on your classpath.
Make sure that you have in your path jackson-databind and jackson-core
build path is used during compile. You need to set up the Deployment Assembly for run time classpath (under project settings, look for Deployment Assembly )
I want to replace the auto injected log object, which is of type org.apache.commons.logging.Log with an object of type org.slf4j.Logger, so that I can use it properly with Logback.
Therefore I need to create a ...Transformer class (written in Java) - that's what I got from Graeme Rocher over at the "grails-user" mailing list. I'm also aware that I have to pack this ...Transformer class within a plugin and make it a *.jar archive which I can load within the lib/ folder of the plugin. But I guess I'm doing something wrong here as I have the class, along with a META-INF folder which contains the MANIFEST.MF file as well as another folder services which holds the following file org.codehaus.groovy.transform.ASTTransformation which holds just one String: the canonical name of the ...Transformer class.
Now, if I try to do a grails clean everything is fine, BUT if I try to run grails package-plugin the console comes up with a java.lang.ClassNotFoundException.
Clipping from Stacktrace:
| Packaging Grails application...
| Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Could not instantiate global transform class my.package.ast.LoggingTransformation specified at jar:file:/C:/Source/MyGrailsAST/lib/replace-logging-logback-ast.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception java.lang.ClassNotFoundException: my.package.ast.LoggingTransformation
1 error
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Could not instantiate global transform class my.package.ast.LoggingTransformation specified at jar:file:/C:/Source/MyGrailsAST/lib/replace-logging-logback-ast.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception java.lang.ClassNotFoundException: my.package.ast.LoggingTransformation
Does anybody have some experience with Grails plugins which handle with AstTransformer and could give me some advice on this? Is there a good tutorial out there which I haven't seen so far?
Please let me know ;)
so, after some research, browsing and finally asking at the Grails Mailing List (see the mailing list archives at: http://grails.1312388.n4.nabble.com/Grails-user-f1312389.html I found a solution.
my goal was to create a Globals ASTTransformation, to inject a org.slf4j.Logger object instead of the usual org.apache.commons.logging.Log object into every Artefact class without annotation.
so, here are the steps:
I created Java class similar to https://github.com/grails/grails-core/blob/master/grails-logging/src/main/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformer.java but with my own implementation of the org.slf4j.Logger object. It is crucial that you place the Java.class under the following package: org.codehaus.groovy.grails.compiler as
Grails scans for classes that are annotated with #AstTransformer in this package. (Graeme Rocher)
and pack it into a JAR along with its MANIFEST.MF file within the META-INF/ folder. A META-INF/services directory with all its stuff is not needed as Graeme Rocher stated:
You do not need the META-INF/services stuff and I would remove it as it is probably complicating matters.
So, I guess this statement was more related to my specific problem as I only have one #AstTransformer class within my plugin, but that's just a guess. And I haven't searched for further informations on this topic. Maybe some other developer here who needs this could do some research and share his solution within this thread...
The JAR should be imported to the plugin and placed under the lib/ directory. After this you should be able to do grails clean, grails compile and grails package-plugin.
If you want to replace the log implementation, as I did, you should exclude the grails-logging and grails-plugin-log4j JARs from your designated project's classpath. This is done in the BuildConfig.groovy file:
inherits("global") {
excludes "grails-plugin-log4j", "grails-logging"
}
Now install your plugin grails install-plugin \path\to\plugin.zip and everthing should work as expected.
Hope this helps...