I'm trying to build a CoAP server in android, and i's using californium's example.
https://github.com/curioustechizen/Californium/tree/4ace5b85974a0646aaaa6ab43c9314d1c5a438e1
But I got error with Http.java in package ch.ethz.inf.vs.californium.layers
it shows
The type org.apache.http.entity.ContentType cannot be resolved. It is indirectly referenced from required .class files
I'm thinking the problem is about the wrong .jar file
the library I imported is like this:
apache-mimne4j.core-0.7.2.jar californium-0.18.7-final.jar
commons-codec-1.6.jar commons-io-2.4.jar commons-logging-1.1.1.jar
google-http-client-1.10.3-beta.jar google-oauth-client-1.10.1-beta.jar
gson-2.1.jar guava-11.0.1.jar httpclient-4.2.1.jar
httpclient-4.3.2.jar httpcore-nio-4.2.1.jar jsr305-1.3.9.jar
junit-3.8.1.jar junit-4.8.1.jar mockito-core-1.8.5.jar
hope anyone can tell me whats the problem or how to fix it, and also ask to some open source about CoAP's android example.
I think you are missing a http-components jar there.
Do you use maven?
Please note: your fork is too old (2 years).
You can find the actual Californium version at https://eclipse.org/californium/
It does not have android support but I see your fork only removes a lot of files and adds an android manifest at most - so it could be done too.
Related
I changed my tomcat version 9 to 8 but when I wrote jar uf ../catalina.jar org/apache/catalina/util/ServerInfo.properties it gave me the following error
jar: Package org.apache.catalina.ssi missing from ModulePackages class
file attribute
How can I solve this issue?
Had the same issue. Upgraded from apache 9.0.16 to 9.0.41, wanted to remove server version/infos, edited ServerInfo.properties, and when time came to
jar uf ../catalina.jar org/apache/catalina/util/ServerInfo.properties
got the same error than you.
I think I found the why :
I opened catalina.jar both on 9.0.16 and 9.0.41, and lo and behold : there is no ssi in org/apache/catalina/ for 9.0.41
Yet the MANIFEST.MF still includes it, as well as the module-info.class
From reading Tomcat changelog, it looks like this happened with tomcat 9.0.30 :
Moved server-side include (SSI) module into a separate JAR library. (schultz)
(looking in the lib directory, it seems like it is catalina-ssi.jar now)
Not sure how clean this is, but I went around the problem by opening catalina.jar with 7zip, modify the ServerInfo.properties from there, saved, restarted Tomcat, and it worked.
That is a really weird issue I'm facing myself right know, excluding
org.apache.catalina.ssi from the module-info.class
using ModiTect helped, hope it won't crash in a long run...
I downloaded the binaries of the latest stable version of apache-mime4j (0.7.2).
Yet, I fail to compile the next code since MboxIterator & CharBufferWrapper classes are not found.
final File mbox = new File("path/name.mbox");
for (CharBufferWrapper message : MboxIterator.fromFile(mbox).charset(ENCODER.charset()).build())
{do something}
The jars included in my build path: apache-mime4j-core-0.7.2.jar, apache-mime4j-dom-0.7.2.jar.
Am I using the wrong jars or version?
I had the same problem but I ended getting it to work by doing a little research.
The classes you mention, at least by what I found, are not included into Mime4J, so you have to code them yourself. Thanks to the devs, they got them uploaded in the following link: MBoxIterator needed classes.
Hope those solve the problem.
You can clone the current snaphshot of the mime4j project from
http://svn.apache.org/repos/asf/james/mime4j/trunk/
to your personal github account
or use my clone:
https://github.com/WolfgangFahl/james-mime4j
and your MBoxIterator is here:
https://github.com/WolfgangFahl/james-mime4j/tree/trunk/mbox/src/main/java/org/apache/james/mime4j/mboxiterator
In my program, I am trying to import below classes but there comes a compile time error for this. Am I missing any jar there ? If yes, then which jar I am missing. Please help me.
"import net.java.util.TagValue;"
I am writing this in eclipse
A simple search on the net shows that net.java.util.TagValue class belongs to fixparser library. Make sure that this library is in your classpath when working on your project.
I get the following error in Endeca:
com.endeca.navigation.ENEException: Navigation Engine not able to process
request `http://myhost:15000/search?terms=remote&rank=0&offset=0&irversion=601`
My MDEX version is 6.3.0
The referenced jar files in my app is:
endeca_navigation.jar : Specification-IR-Version: 6.3.0 (Read from MANIFEST file)
endeca_logging.jar: Specification-Version: 6.1.2 (Read from MANIFEST file)
Even with these referenced jars, why is the request parameter still irversion=601?
I'm using java 1.5 and building my app in eclipse. At first, it was referencing older jar files (601), but i removed those completely and replaced them with the newer jar files listed above. I've rebuilt my app and I still see the parameter irversion=601. I've been trying to find out what the issue is for a few hours, but i'm having no luck.
Any ideas?
If nothing else I think that you need an N=0 parameter for you request to work.
Also if you are using an application server like Weblogic to run you app, it has a tendency of caching referenced jars which may have to be cleared for it to pick up the new versions of the jars.
Finally if all else fails there is a --back_compat 601 parameter on your dgraph which indicated the accepatble navigation.jar versions. You can use this parameter to determine if the issue is the jar version or something else in between.
Good Luck
Additionally to Wiszh's response, it is useful to take a look at the dgraph request query logs (located in /logs/dgraph/Dgraphxx/Dgraphxx.log and .reqlog) which will show a more specific error and the query that caused it.
Do your jars match the version of Endeca server you are querying?
This issue is due to an old navigation api jar in your class path
Check the ToolsAndFrameworks\version\assembler\lib to get the correct version of navigation api jar. That should fix this issue.
correct jar path fixed the issue for me
ToolsAndFrameworks\version\assembler\lib
I am taking the input from the web, which is an Xml file and converting into a Json data using the library json-lib . I have created a user library and added the following jars into it:-
json-lib-2.3-jdk15.jar
commons-collections.jar
commons-lang.jar
commons-logging.jar
commons-beanutils.jar
ezmorph-1.0.6.jar
xom-1.1.jar
But still gives the following error:-
08-04 13:58:31.642: ERROR/dalvikvm(484): Could not find class 'net.sf.json.xml.XMLSerializer$CustomElement', referenced from method net.sf.json.xml.XMLSerializer.addNameSpaceToElement
Can anyone help me out in resolving this issue.
Either you have a sdk level / jdk level conflict. I mean dalvik can't get the byte code of the CustomElement class of your librairy as it is compiled with to recent features for your SDK like annotations for instance.
Or there is a conflicting librairy json-lib in some other of your jars or lib folders.
(the 3 first comments are not relevant, it's just the way inner classes are compiled, using a $)
Regards,
Stéphane
Since android already support json org.json a different json library may conflict. (You can download the jar here)
Try to use this library instead of an external library on android.
BTW: You can also use this library if you need on any java code (not only android)