首页 \ 问答 \ XStream NoClassDefFoundError(XStream NoClassDefFoundError)

XStream NoClassDefFoundError(XStream NoClassDefFoundError)

在这一天的大部分时间里,我一直在撞墙。 我将xstream-1.4.2添加到java构建路径并从我的代码中调用它没有问题:

XStream yyz = new XStream();
String str_xml = yyz.toXML(ld_data);

一切都编译但是当执行到达上面的第一行(XStream实例化)时,我得到下面的堆栈跟踪中看到的错误。 在我看来,这个错误表明它无法找到XStream对象,但它的智能感知和编译是gtg。 我在Eclipse中用来添加外部文件的步骤是:

右键单击项目>构建路径>配置构建路径。

在左侧的Java Build Path右侧,选择Libraries选项卡。

在右键单击Add External jar's,然后浏览到XStream文件并添加它。 点击确定然后跑进了错误?

致命异常:主要java.lang.NoClassDefFoundError:com.thoughtworks.xstream.XStream at org.gpgvm.ironmike.IcyArmActivity.onOptionsItemSelected(IcyArmActivity.java:166)at android.app.Activity.onMenuItemSelected(Activity.java:2205)at com.android.internal.view中的com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:748)位于com.android.internal.view的com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)。 menu.MenuBuilder.performItemAction(MenuBuilder.java:855)at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView。 java:122)在android.view.View.Handler.dispatchMessage(Handler.java:92)的android.view.View $ PerformClick.run(View.java:9080)android.os.Handler.handleCallback(Handler.java:587) )在android.app.Looper.loop(Looper.java:123)的android.app.ActivityThread.main(ActivityThread.java:3683)java.lang.reflect.Method.invokeNative(Native Method)at java.lang 位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java)的com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:839)中的.reflect.Method.invoke(Method.java:507) :597)at dalvik.system.NativeStart.main(Native Method)


引起:java.lang.ClassNotFoundException:com.thoughtworks.xstream.XStream


在dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)中的装载程序dalvik.system.PathClassLoader [/data/app/org.gpgvm.ironmike-2.apk]中的java.lang.ClassLoader.loadClass(ClassLoader.java) :551)在java.lang.ClassLoader.loadClass(ClassLoader.java:511)... 17更多

关于我缺少什么的任何想法? JB


I've been beating my head against the wall most of the day on this one. I added the xstream-1.4.2 to java build path and call it from my code no problems:

XStream yyz = new XStream();
String str_xml = yyz.toXML(ld_data);

Everything compiles but when the execution reaches the first line above (XStream instantiation) I get the error seen in the stack trace below. The error seems to me to indicate that it can't find the XStream object yet it does as intellisense and compilation are gtg. The steps I used in Eclipse to add the external file are:

right click project > Build Path > Configure Build Path.

On the left Java Build Path on the right select the Libraries tab.

On the right click the Add External jar's and then browsed to XStream file and added it. Hit OK and ran smack into the error??

FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.thoughtworks.xstream.XStream at org.gpgvm.ironmike.IcyArmActivity.onOptionsItemSelected (IcyArmActivity.java:166) at android.app.Activity.onMenuItemSelected(Activity.java:2205) at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected (PhoneWindow.java:748) at com.android.internal.view.menu.MenuItemImpl.invoke (MenuItemImpl.java:143) at com.android.internal.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:855) at com.android.internal.view.menu.IconMenuView.invokeItem (IconMenuView.java:532) at com.android.internal.view.menu.IconMenuItemView.performClick (IconMenuItemView.java:122) at android.view.View$PerformClick.run(View.java:9080) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3683) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method)


Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.XStream


in loader dalvik.system.PathClassLoader[/data/app/org.gpgvm.ironmike-2.apk] at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) at java.lang.ClassLoader.loadClass(ClassLoader.java:551) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) ... 17 more

Any ideas as to what I'm missing? JB


原文:https://stackoverflow.com/questions/10956358
更新时间:2022-10-30 16:10

最满意答案

如果只有你正在开发我会一步一步地做,这意味着你从iOS应用程序的一部分开始,然后执行所需的后端功能并测试它。 之后,继续iOS App的下一步,然后再继续后端,依此类推。 这些步骤可以分为以下几个步骤:

  • 注册
  • 登录
  • 用户资料
  • 编辑个人资料
  • 发布东西
  • 用户Feed
  • 添加/关注其他用户
  • ...

如果你是一个团队工作,你可以拆分工作,有人正在做一个后端其他人的应用程序。 所以你基本上保持了上述步骤,但你可以同时进行测试。


If it's only you who is developing I would do it step by step, meaning you start with a part of the iOS App and then do the required backend functionality and test it. Afterwards you move on with the next step of the iOS App and then backend again and so on. These steps could be split into the following:

  • Registration
  • Login
  • User profile
  • Edit profile
  • Posting stuff
  • User feed
  • Adding/following other users
  • ...

If you're working as a team you can split the work, someone is doing backend someone else the App. So you're basically keeping the steps above but you can work on and test them simultaneously.

相关问答

更多
  • 在我看来,GameKit是你最好的选择。 官方文档太棒了,应该引导你完成,尽管它本身不是教程。 这里有一对夫妇: http://vivianaranha.com/apple-gamekit-bluetooth-integration-tutorial/ http://www.devx.com/wireless/Article/43502/1954 你可以查看BeamIt的源代码! http://arctouch.com/beamit/ 希望有所帮助。 GameKit is your best bet, in ...
  • 我看过两者,BuddyPress似乎有更多现成的插件,因为它是自己的wordpress插件。 对于数据库而言,对于elgg而言,buddypress似乎有点发展。 I have looked at both, BuddyPress seems to have more off the shelf plugins as it is in it's self a plugin of wordpress. buddypress seems a little eaiser to develop for when i ...
  • 如果您需要所有社交网络,请尝试使用此库。 socialauth If you need all social networks, try this library. socialauth
  • 这是非常广泛的功能。 以下是一些相关项目: OpenSocial Java客户端 - 它实现OpenSocial协议 Spring-social允许与流行的社交网络进行整合 Apache Shindig是一个开放式社交平台。 This is very broad functionality. Here are some related projects: OpenSocial Java client - it implements the OpenSocial protocol Spring-social ...
  • 您可以尝试mknetworkkit它已准备好ARC。 而且看起来很有趣。 You can try mknetworkkit It is ARC ready. And looks very interesting.
  • 如果只有你正在开发我会一步一步地做,这意味着你从iOS应用程序的一部分开始,然后执行所需的后端功能并测试它。 之后,继续iOS App的下一步,然后再继续后端,依此类推。 这些步骤可以分为以下几个步骤: 注册 登录 用户资料 编辑个人资料 发布东西 用户Feed 添加/关注其他用户 ... 如果你是一个团队工作,你可以拆分工作,有人正在做一个后端其他人的应用程序。 所以你基本上保持了上述步骤,但你可以同时进行测试。 If it's only you who is developing I would do ...
  • 您可以使用iPhone中的循环每1-2分钟检查一次新数据。 iPhone应用程序可以调用您的服务来检查是否有新信息,如果没有,您返回一个代码告诉。 如果它有新信息,您将以特定格式返回新信息。 服务器和iPhone应用程序必须同意相同的xml格式 You can probably using a loop in your iPhone to check for new data every 1-2 minute. iPhone app can call your service to check if the ...
  • 您可能会发现Ray Wenderlich网站上的教程很有用。 有许多初学者教程和至少一个涵盖后端集成的教程。 对于后端解决方案,我发现parse.com和kinvey的服务非常有用。 这两个网站还提供有关iOS的教程和示例。 特别是,Kinvey提供了一些用于创建社交应用程序的iOS示例。 You might find the tutorials on Ray Wenderlich website useful. There are lots of tutorials for starters and at ...
  • 简单地说:你在孵化前计算你的鸡。 如果你被一群新用户所淹没,那么这就是我们所谓的“好问题”。 如果您一直担心可扩展性 ,那么您应该考虑: 使用Memcached或Redis进行缓存。 负载均衡 。 从Apache切换到Nginx 。 提供适当的CDN 。 由于您使用的是PHP,因此您应该安装opcache 。 挤出结果的方法有很多种。 在你需要它们之前,我建议坚持使用最佳实践(规范化等)。 Simply put: You are counting your chickens before they hatc ...
  • 看到这个问题进行类似的讨论(仅限于Facebook登录)。 以下是对应该发生的事情的高级概述(取自我所链接的讨论): 用户在手机上打开应用程序。 选择一个服务进行身份验证。 通过一个可用的服务(Facebook,Twitter,Foursquare等)进行身份验证并获得一些特殊的access token 。 您的应用程序将获取令牌并将其发送到您的服务器。 您的服务器收到令牌并进行验证。 它根据服务的API检查它并(至少在Facebook和Twitter上)获取相应的用户ID。 假设一个有效的ID,你的服务器 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)