virajpu / androjena

Automatically exported from code.google.com/p/androjena
0 stars 0 forks source link

NoClassDefFoundErrror on QueryFactory Class #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hallo,
I would like to query sparql on dbpedia. 
I am getting an error that I cannot query via QueryFactory. The error is 
NoClassDefFoundErrror. 
I imported the QueryFacrotry class already ( import 
com.hp.hpl.jena.query.QueryFactory ; ) and gave the permission of Internet in 
manifest.xml ( <uses-permission android:name="android.permission.INTERNET" /> 
). 

The error line is: Query query = QueryFactory.create(queryString);

The Libraries are androjena_0.5 and arqoid_0.5 
Test is on Android 2.1 (Eclair)

Thanks 

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

If you're using a real device and not the emulated AVD, what is the device
model?

What version of Android runs on your device/emulated AVD? (please put an X
next to the correct version)

Android 1.1
Android 1.5 (Cupcake)
Android 1.6 (Donut)
Android 2.0/2.1 (Eclair)
Android 2.2 (Froyo)
Android 2.3 (Gingerbread)
Android 3.0 (Honeycomb)

What version of Android is your application targeting? (please put an X
next to the correct version)

Android 1.1
Android 1.5 (Cupcake)
Android 1.6 (Donut)
Android 2.0/2.1 (Eclair)
Android 2.2 (Froyo)
Android 2.3 (Gingerbread)
Android 3.0 (Honeycomb)

What IDE/environment are you developing with? (Eclipse w/ ADT, Android SDK
w/ Apache Ant, ...)

What operating system and hardware is your IDE/development environment
running on?

Please attach the following application files (when applicable):

- AndroidManifest.xml
- .classpath
- default.properties
- a full LogCat dump from application launch to exception/crash
- a meaningful portion of the source code where the exception is thrown

Please provide any additional detail below

Original issue reported on code.google.com by engi...@gmail.com on 6 Jan 2011 at 2:08

Attachments:

GoogleCodeExporter commented 8 years ago
Seems like you didn't reference the correct libraries. Anyway, in order to 
better understand the problem, i need you to provide all the requested 
informations, in particular:
- a full LogCat dump from application launch to exception/crash
- a meaningful portion of the source code where the exception is thrown
Thanks,
lorenzo

Original comment by loreca...@gmail.com on 6 Jan 2011 at 4:16

GoogleCodeExporter commented 8 years ago
maybe this you mean? 
i tried long how to fix it, but could not unfortunately. 

Original comment by engi...@gmail.com on 18 Jan 2011 at 5:01

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by engi...@gmail.com on 18 Jan 2011 at 5:15

Attachments:

GoogleCodeExporter commented 8 years ago
You get this exception because you're missing the slf4j-android library:

java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory

As explained in the README file, in order to use ARQoid, your Android project 
must reference ALL the following libraries (available in the zip archive):

- arqoid_0.5.jar
- lib/slf4j-android-1.6.1-RC1.jar
- lib/lucenoid_3.0.2.jar
- lib/iri-0.8.jar
- lib/icu4j-3.4.5.jar
- lib/androjena_0.5.jar

In order to reference these libraries in your project under Eclipse, copy them 
somewhere in your project folder, right click on your project's name in the 
Package Explorer, choose Build Path -> Configure Build Path, and, under the 
Libraries tab, click Add Jar and choose the jars you copied.

Please let me know if this solves the problem, so that i can close the issue.
Bye,
lorenzo

Original comment by loreca...@gmail.com on 18 Jan 2011 at 6:35

GoogleCodeExporter commented 8 years ago
hi, sorry. i tried today only with androjena_0.5.jar and arqoid_05.jar ;
So, i referenced all jar files in arqoid_05 zip file, but I still have this 
issue. 
I send now also the project. 

Original comment by engi...@gmail.com on 18 Jan 2011 at 6:44

Attachments:

GoogleCodeExporter commented 8 years ago
By the way, Thank you for your help. 
This is third logcat.txt. 
There is a missing class, QueryFactory, but I already imported it. 
Regards,
Engince

Original comment by engi...@gmail.com on 18 Jan 2011 at 7:14

Attachments:

GoogleCodeExporter commented 8 years ago
Your project references a user defined library, which doesn't work with adt 
(the contained libraries are not bundled in the apk package).
You have to reference the single libraries, as explained in the previous 
comment. 
I've attached a modified version of your project with an empty lib folder: just 
copy the required libraries in the lib folder and rebuild you project from 
scratch (Project->clean): the libraries should be bundled in your apk correctly 
(it should be about 5 Mbs). I've corrected a couple bugs in the code, and now 
it calls dbpedia and retrieve results successfully.
Hope this helps, please let me know
bye

Original comment by loreca...@gmail.com on 18 Jan 2011 at 8:48

Attachments:

GoogleCodeExporter commented 8 years ago
Hello again,
it works now! Thank you very much for your help. 

Original comment by engi...@gmail.com on 18 Jan 2011 at 10:37

GoogleCodeExporter commented 8 years ago

Original comment by loreca...@gmail.com on 19 Jan 2011 at 8:16

GoogleCodeExporter commented 8 years ago
Hi, 
i have one more question please. When i build the project, it works normal, 
when I change something in code (also only comment), and rebuild the project to 
see on mobile devide. 
it hangs like on screen shot as attached. it might be because of libraries?

Original comment by engi...@gmail.com on 19 Jan 2011 at 1:04

Attachments:

GoogleCodeExporter commented 8 years ago
Yes, it's because of libraries. Quoting from ARQoid README (please, read it!):

Please don't freak out if your project's build time will be considerably longer 
than before: Android uses 
the dx tool to extract the class files from Androjena jars and convert them to 
Dalvik bytecode format, 
and finally packages them, as long as your project's code, inside a classes.dex 
files. This translation 
process takes long, and is unavoidable by now (maybe the next releases of 
Android SDK Tools will be faster 
or will implement some sort of caching). If you want to speed up your code 
writing at least, please disable
the Build Automatically option under the Project menu.

Original comment by loreca...@gmail.com on 19 Jan 2011 at 3:09

GoogleCodeExporter commented 8 years ago
Thank you. just wanted to be sure. 

Original comment by engi...@gmail.com on 20 Jan 2011 at 5:05

GoogleCodeExporter commented 8 years ago
Excuse me,i want some help
i am studying about android jena, And i have a same problem (i get 
NoClassDefFoundErrror  on QueryFactory)but Now i still don't solve the problem.

PS. i am very apologies that i try to open the your revision 
folder(mmTubePOI.zip) but it is empty, i can't not see anything. Hope you help 
me 
Thank you :)

Original comment by tanaporn...@gmail.com on 4 Jul 2013 at 3:43

GoogleCodeExporter commented 8 years ago
hi,
i got this error, because of I imported the library as "User Library". import 
it please directly. 
regards,

Original comment by engi...@gmail.com on 10 Jul 2013 at 8:41

GoogleCodeExporter commented 8 years ago
hello again
if you don't mind can you explain more about import lib directory. How to do 
it. 

Thank you so much

Original comment by tanaporn...@gmail.com on 10 Jul 2013 at 3:25

GoogleCodeExporter commented 8 years ago
check this please. i hope this helps. 

http://www.youtube.com/watch?v=eY_uqi_qIz0

Regards,

Original comment by engi...@gmail.com on 10 Jul 2013 at 6:20

GoogleCodeExporter commented 8 years ago
i can do it already. :D

Thank you

Original comment by tanaporn...@gmail.com on 11 Jul 2013 at 1:49

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Sorry, again 
it can work only test android program (android emulator) but i make it to .apk 
file. it can not work on mobile phone. Is it problem about my mobile. 

regard. :)

Original comment by tanaporn...@gmail.com on 12 Jul 2013 at 3:58

GoogleCodeExporter commented 8 years ago
Hi, I know there is a long time since the last comment, but now I am working on 
a project using android 4.3 and jena, I want to connect one activity of my app 
with dbpedia and using the sparql query ask things and retrieve data. But when 
I connect the libraries that I use on a normal Java aplication into my android 
app it works but when I open the activity it crashes and throws an 
Java.Lang.NoClassDefFound. 

I tried to follow this steps, but when I did what it says in the README file it 
just keep on launching the app for 5 minutes and the force close the eclipse 
ADT plugin...

Do you have an idea? 

Thank you so much

Original comment by jppe86 on 29 Apr 2014 at 5:36