Android NoClassDefFoundError 出错,怎么解决?

因为需要引入第三方工程ViewPagerIndicator,但是在引入后在手机上测试时报错。
按照网的方法,将lib文件夹改成libs,但是我是引入的是工程,而且项目本身就是自带的libs文件夹,
网上也说将引入的工程在Build Path--Libraries--添加依赖工程,再order and Export选中依赖工程,但是这几种方法都不行。
求解答。

Cause by:java.lang.NoClassDefFoundError:Failed resolution of :Lcom/Viewpagerindicator/R$attr;

2个回答

打开attrs这个文件,里面有错呢!

没有,现在只要是添加第三方依赖工程,依赖库工程涉及到资源文件,(只要依赖工程中有 R。点出来自己写的资源,如R.layout.xxx ; R.attr.xxx),那么就会报这个错。
项目是之前好好的,只是作死更新了一版ADT,结果就悲剧了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
NoClassDefFoundError怎么解决
我在dos下直接用java Hellorn却出现了java.lang.NoClassDefFoundError:Hello的错误,但是在IDE中运行却没有问题,rn这是怎么回事?
Hibernate出错NoClassDefFoundError
HibernateUtil照搬网上的,映射文件和类文件是用hibernate-extensions-2.1.3生成的,按书上的一步步作,最后总是 NoClassDefFoundError,位置在Session session = HibernateUtil.currentSession();rn不知何原因rnrn注意是NoClassDefFoundError,而不是NoClassDefFoundError: net/sf/hibernate/HibernateException。rn(我手工把hibernate必须库加到lib里面了,否则就是NoClassDefFoundError: net/sf/hibernate/HibernateException,这个是毫无疑问的classpath问题)rn第一次和之后运行时错误有一点不同,第一次是ExceptionInInitializerError,之后就是NoClassDefFoundErrorrnrn第一次运行时错误:rnrnjavax.servlet.ServletExceptionrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)rn org.apache.jsp.hibernateTest_jsp._jspService(org.apache.jsp.hibernateTest_jsp:83)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnroot causernrnjava.lang.ExceptionInInitializerErrorrn org.zzd.listBean.getList(listBean.java:31)rn org.apache.jsp.hibernateTest_jsp._jspService(org.apache.jsp.hibernateTest_jsp:60)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrn之后运行时错误:rnrnjavax.servlet.ServletExceptionrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)rn org.apache.jsp.hibernateTest_jsp._jspService(org.apache.jsp.hibernateTest_jsp:83)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnroot causernrnjava.lang.NoClassDefFoundErrorrn org.zzd.listBean.getList(listBean.java:31)rn org.apache.jsp.hibernateTest_jsp._jspService(org.apache.jsp.hibernateTest_jsp:60)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrn==================================rnrnrnHibernateUtil.java:rnrnpackage org.zzd.db;rnrnimport net.sf.hibernate.*;rnimport net.sf.hibernate.cfg.*;rnrnpublic class HibernateUtil rn private static final SessionFactory sessionFactory;rn static rn try rn // Create the SessionFactoryrn sessionFactory = new Configuration().configure().buildSessionFactory();rn catch (HibernateException ex) rn throw new ExceptionInInitializerError(ex);rn rn rnrn public static final ThreadLocal session = new ThreadLocal();rnrn public static Session currentSession() throws HibernateException rn Session s = (Session) session.get();rn // Open a new Session, if this Thread has none yetrn if (s == null) rn s = sessionFactory.openSession();rn session.set(s);rn rn return s;rn rnrn public static void closeSession() throws HibernateException rn Session s = (Session) session.get();rn if (s != null)rn s.close();rn session.set(null);rn rnrnrnrn===================================rnrnrnlistBean.java:rnrnpackage org.zzd;rnrnimport java.util.*;rnimport net.sf.hibernate.*;rnimport net.sf.hibernate.cfg.*;rnrnimport org.zzd.db.*;rnrnpublic class listBean rn private String s_query = null;rn rn public void setS_query(String string) rn s_query = string;rn rn /** Creates a new instance of listBean */rn public List getList() throws HibernateException rn List list = null;rn Session sess = HibernateUtil.currentSession();rn try rn Transaction tx = sess.beginTransaction();rn Query query = sess.createQuery(s_query);rn list = query.list();rn tx.commit();rn rn finally rn HibernateUtil.closeSession();rn rn return list;rn rnrnrnrn==================================
一个NoClassDefFoundError的解决过程
内含分析过程,如寻找答案,直接查看解决方式。 今天在android studio项目内添加了几个jar包之后突然项目就跑不起来了,直接崩溃。在logcat看日志,报错信息如下: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.san.bili, PID: 31934 java.la...
解决Android运行过程中出现的NoClassDefFoundError
1、先说一下出现上述问题的经过 出现这个问题是集成一个aar之后,编译过程中没有问题。在安装运行的时候出现上述错误。然后百度各种解决办法都无济于事。但是有了一点思路。 报错位置 在自定义的application中初始化的aar导致的程序崩溃。 解压apk反编译打包的apk,发现报错的class存在,但是仍然报这个错误。 最终原因是libs里面添加的jar包,和aar里
NoClassDefFoundError错误如何解决
作了一个邮件程序如下:rnrnimport java.util.Properties;rnimport javax.mail.*;rnimport javax.mail.internet.*;rnimport javax.mail.internet.MimeMessage;rnrnrnpublic class mailrn public static void main(String[] args) throws Exception rn Properties props=new Properties();rn props.put("mail.smtp.host","192.168.42.253");rn Session session=Session.getDefaultInstance(props,null);rn rn Message msg=new MimeMessage(session);rn rn InternetAddress addressFrom=new InternetAddress("vbul@jcct.com");rn msg.setFrom(addressFrom);rn InternetAddress addressTo=new InternetAddress("ky@jcct.com");rn msg.setRecipient(Message.RecipientType.TO,addressTo);rn rn msg.setSubject("text");rn msg.setContent("text one","text/plain");rn rn Transport transport=session.getTransport("smtp");rn transport.send(msg);rn rn rnrnrn能通过编译,但运行时提示:rnrnException in thread "main" java.lang.NoClassDefFoundError:javax/activation/DatarnSource rn at mail.mainrnrnrn请问如何解决阿?
NoClassDefFoundError这个错误怎么解决啊
以前做个程序,一直都好用,可是今天在用就出现了上面的错误,这个程序还有用那,怎么解决啊,各位高手帮帮忙..
android中NoClassDefFoundError
最近的项目有一个偶现的error,看了log是java.lang.NoClassDefFoundError: ,网上搜了关于该exception的问题,一般都是因为引入jar包sdk不匹配导致的。但是我的这个类是自己写的,不知道为什么也会出现这种error,求大神指教!!!!!rnrnrn报错的log:java.lang.NoClassDefFoundError: com/test/weather/widget/WeatherWidgetTestrnrn对应的代码是:WeatherWidgetTest.updateWidgets(context, isWeatherUpdate);rn public static boolean updateWidgets(Context context, boolean isWeatherUpdate) rn ComponentName provider = new ComponentName(context,rn context.getPackageName() + ".widget.WeatherWidgetTest");rn AppWidgetManager gm = AppWidgetManager.getInstance(context);rn int[] appWidgetIds;rn appWidgetIds = gm.getAppWidgetIds(provider);rn final int Num = appWidgetIds.length;rn for (int i = 0; i < Num; i++) rn WeatherWidgetTest.updateAppWidget(context, gm,rn appWidgetIds[i], isWeatherUpdate);rn rn return Num > 0;rn
Eclipse和Android错误-NoClassDefFoundError
我有一个android应用程序一直运行的很好,直到我添加第二个外部库来创建路径的时候,它就出现了问题。自从添加了scoreninja jar,当我试图运行这个程序的时候我就得到了NoClassDefFoundErrorrn这是报错信息rnrn 09-19 21:45:26.154: ERROR/AndroidRuntime(3654): java.lang.NoClassDefFoundError: com.scoreninja.adapter.ScoreNinjaAdapterrnrn像所有通过android工具生成的脚本一样,我不知道除了删除和重新创建或者重启eclipse(我已经试过三次了)我还能做什么。有人知道我能怎样改正这个么?rn
eclipse 调用 jboss 出错,NoClassDefFoundError
命令行如下:rn "E:\Program Files\j2sdk1.4.2_05\bin\javaw.exe" -Djboss.home=E:\Program Files\jboss-3.2.5 -classpath "E:\Program Files\jboss-3.2.5\bin\run.jar;E:\Program Files\j2sdk1.4.2_05\lib\tools.jar" -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,suspend=y,address=localhost:4106 org.jboss.Mainrnrn出错:rnjava.lang.NoClassDefFoundError: Files\jboss-3/2/5rnException in thread "main" rnrn怎么回事啊?55555555555555
java项目使用jni出错NoClassDefFoundError
Caused by: java.lang.NoClassDefFoundError: com.yhty.service.impl.other.GetOweInfoByTuxedo (initialization failure)rnat java.lang.J9VMInternals.initialize(J9VMInternals.java:134)rnat com.yhty.service.impl.other.PhonePaymentManagerImpl.getOweInfo(PhonePaymentManagerImpl.java:46)rnat sun.reflect.GeneratedMethodAccessor2060.invoke(Unknown Source)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rnat java.lang.reflect.Method.invoke(Method.java:618)rnat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rnat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rnat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rnat $Proxy315.getOweInfo(Unknown Source)rnat com.yhty.ws.impl.IplatformServiceManagerImpl.getOweInfo(IplatformServiceManagerImpl.java:1254)rnat sun.reflect.GeneratedMethodAccessor2059.invoke(Unknown Source)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rnat java.lang.reflect.Method.invoke(Method.java:618)rnGetOweInfoByTuxedo声明native方法的类,在调用时出现上面异常信息,说是初始化错误,那位大神知道原因吗?纠结好长时间了。
NoClassDefFoundError
项目中导入了第三方包。为什么还出现rnCould not find class 'org.ksoap2.serialization.SoapObject', ???
noclassdeffounderror
package com.pllpwy.Login;rn rnpublic class LoginUI implements ActionListener rn JFrame j;rn JLabel jLabel1;rn JLabel jLabel2;rn JLabel jLabel3;rn JLabel jLabel4;rn JButton jButton3;rn JButton jButton2;rn JButton jButton1;rn JPasswordField jPasswordField1;rn JTextField jTextField1;rn Icon i;rnrn public LoginUI() rn j = new JFrame();rn //节省空间。代码略。。。rn j.setResizable(false);rn j.setLocation(300, 200);rn j.setVisible(true);rn j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rnrn rnrn public void actionPerformed(ActionEvent e) rnrn char[] pwd = jPasswordField1.getPassword();rn String userpwd = new String(pwd);rn String username = jTextField1.getText();rnrn //JOptionPane.showMessageDialog(null, e.getActionCommand());rnrn rnrn public static void main(String[] args) rn new LoginUI();rn rnrnrnrnrn为什么在eclipse下面运行的时候提示:rnjava.lang.NoClassDefFoundError: com/pllpwy/Login/LoginUIrnCaused by: java.lang.ClassNotFoundException: com.pllpwy.Login.LoginUIrnrn它执行的时候,明显执行到了LoginUI文件夹下面去了。这个文件夹肯定不存在的了,这个是邮什么引起的?
noclassdeffounderror!!
编辑c>f2sdk1.4.2_02\bin>javac c:\f2sdk1.4.2_02\HelloWorld.javarnrn执行c>f2sdk1.4.2_02\bin>java c:\f2sdk1.4.2_02\HelloWorldrn编辑没问题,为什么执行的时候会出现noclassdeffounderror的错误呢rn怎么改呢??rn如果要设置classpath有该怎么做呢
NoClassDefFoundError?
这个错误是什么意思?
android studio运行出错怎么解决??
![图片说明](https://img-ask.csdn.net/upload/201505/24/1432474463_870598.png)
Android项目运行出错,该怎么解决?
Android项目运行提示如下错误:rn该怎么解决?rnrnrn```rncom.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for detailsrnrn```rn![图片说明](https://img-ask.csdn.net/upload/201904/27/1556354228_630003.png)
解决OSGI环境第三方包的NoClassDefFoundError
总结了一下:1、把第三方包的class文件改造为一个bundle,export所有的package2、使用了eclipse的equinox实现启动所有bundle3、在eclipse环境下启动都正常,但是放在命令行(windows/linux都一样)启动,都失败,即出现:Exception in thread 'Thread-1' java.lang.NoClassDefFoundError: j...
Applet报告NoClassDefFoundError如何解决?
用一个 AbsoluteLayout.jar 中的一些类库(jdk1.4并不提供,sun的forte中自带的) rn将其设置在系统classpath中 rn rn做应用程序,一切现实正常 rn做applet,下载后却无法显示 rn错误如下: rn rnjava.lang.NoClassDefFoundError: org/netbeans/lib/awtextra/AbsoluteLayout rn at chat.chatClient.initComponents(chatClient.java:71) rn at chat.chatClient.init(chatClient.java:33) rn at sun.applet.AppletPanel.run(Unknown Source) rn at java.lang.Thread.run(Unknown Source) rn rn似乎总报告说找不到该类 rn rn请指教 , 谢谢 rn
解决:NoClassDefFoundError: javax/faces/FacesException
NULL 博文链接:https://jyao.iteye.com/blog/1235905
删除文件出错怎么解决?
我机子是XP系统,在删除一些无用的文件时出错,弹出提示框,说无法删除文件:访问被拒绝,请确认磁盘未满或未被写保护,而其文件未被使用。不知道该如何解决,请赐教,谢谢!
导入数据出错,怎么解决?
看下图,我想备份数据(追加),但出现如下提示:rnhttp://img28.photo.163.com/xmlboy/6236435/122218795.jpg
这个出错怎么解决
<%set rs=server.Createobject("adodb.recordset")rnsql="select * from user where username="&username&"" rnrs.Open sql,conn,3,3rnif not rs.eof thenrnif trim("password")=trim(rs("password")) thenrnresponse.write" 欢迎你 "&username&" ,你的密码是 "&password&" ,你已经成功登录系统,可以正常使用"rnelsernResponse.write" "rnend ifrnend ifrn %>rn不管怎么样都能登陆,
为何出错?怎么解决??
rnString a="24*28";rnrnint[] se = a.split("*");rnrn为何出错?怎么解决??
出错,不知道怎么解决。
10-26 13:02:11.983: ERROR/AndroidRuntime(475): java.lang.RuntimeException: Unable to resume activity com.mp3player/com.mp3player.LocalMp3ListActivity: java.lang.NullPointerExceptionrn这是空指针异常?rnAndroidManifest.xml文件内容rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn应该是这段代码的问题:rn protected void onResume() rn FileUtils fileUtils = new FileUtils();rn List mp3infos = fileUtils.getMp3Files("mp3/");rn List> list = new ArrayList>();rn for(Iterator iterator = mp3infos.iterator();iterator.hasNext();)rn Mp3Info mp3info = (Mp3Info)iterator.next();rn HashMap map = new HashMap();rn map.put("mp3_name", mp3info.getMp3Name());rn map.put("mp3_size", mp3info.getMp3Size());rn list.add(map); rn rn SimpleAdapter simpleAdapter = new SimpleAdapter(this,list,R.layout.mp3info_item,new String[]"mp3_name","mp3_size",new int[]R.id.mp3_name,R.id.mp3_size);rn setListAdapter(simpleAdapter);rn super.onResume();rn
修改注册表出错,怎么解决?
Win7升级到Win10后,rnrnTRegistry *Reg = new TRegistry;rnrnReg->RootKey = HKEY_CURRENT_CONFIG;rnReg->OpenKey("Software\\Fonts", true);rnrnif (!Reg->ValueExists("MM"))rnrn Reg->WriteInteger("MM", 12);rnrnelsernrn Reg->WriteInteger("MM", 6);rnrnrn修改注册表出错:rnProject MDIAPP.exe raised exception class ERegistry Exceptionwith message 'Failed to set data for 'MM''.rn
运行是出错!NoClassDefFoundError,请大家帮忙!
rn我的程序编译通过了,但是运行是总出现这样的错误(我感觉是构造函数出错,但是不知道怎么改),请大家帮帮忙!rnrnException in thread "main" java.lang.NoClassDefFoundError: dicrnrn我的程序如下:rnpackage assignment.ir;rnimport java.io.*;rnimport java.util.*;rnimport assignment.ir.*;rnrnpublic class Dict rn private LinkedList dictinary;rn rndictinary=new LinkedList(); //字典容器rn Dict() rn tryrn BufferedReader in1 =rn new BufferedReader(rn new FileReader("dictionary.txt"));//可加文件检查,rn //字典已排好序(按字典序)rn String s= new String();rn while((s = in1.readLine())!= null)rn //System.out.println(s+" size="+s.length());rn dictinary.add(s);rn rnrn in1.close();rnrn rnrn catch(IOException e) System.out.println("dictinary file cann't open!");rnrn rnrn public String getWord(char c)rn char temp[]=c;rn String ss=new String(temp);//?have another mether to rn //convert a char to a string?rnrn int size=dictinary.indexOf(ss.toUpperCase());//我想这个c应该是字母了rn return (String)dictinary.get(size+1);rnrn rnrn public String getNextWord(String s)rn int dsize=dictinary.size();rn int ssize=dictinary.indexOf(s);rn if(ssize==-1 || ssize==(dsize-1))rn return (String)dictinary.get(0);//如果已经到字典么为,rn //或单词不再词典中,返回第一个单词!rn return (String)dictinary.get(ssize+1);rn rn public static void main(String[] args)rn Dict ss=new Dict();rn // System.out.println(ss.getWord('b'));rn rn rnrnrn
编译可以通过,执行时出错:NoClassDefFoundError,
在D:\C\Load下,有te.java,和com等文件夹,包含用户类rn环境变量里也设置了classpath路径rnrn编译可以通过,执行却出错:rnrnte.java源代码:rnimport com.apex.util.loader.FileReader;rnimport com.apex.util.loader.LiveLoader;rnimport java.lang.reflect.Method;rnimport java.security.Security;rnimport java.util.Set;rnimport org.bouncycastle.jce.provider.BouncyCastleProvider;rnrnpublic class te rn public void main (String args[])rn rn initProvider();rn FileReader reader = new FileReader();rn try rn byte rs[] = reader.getResource();rn String str = new String(rs , "UTF-8");rn System.out.println(str);rn rn catch(Exception exception1) rn rn rn private void initProvider()rn rn Set als = Security.getAlgorithms("Cipher");rn if(!als.contains("RSA"))rn Security.addProvider(new BouncyCastleProvider());rn rnrnrn执行提示错误是:rnException in thread "main" java.lang.NoSuchMethodError: mainrnrn网上查了很多帮助,说classpath没有设置好,rn但是我就不明白,为何编译可以通过,而执行却不可以,rn编译是:javac te.javarn执行是:java ternrn都没有特殊指定class,为何不可以?到底哪里出错了???
运行客户端LxClient提示出错 NoClassDefFoundError
通过编译后 运行java LxClientrn提示信息是:rnException in thread "main" java.lang.NoClassDefFoundError: LxClientrn//看了下java 文件 类的定义 和 mian方法 好象都没什么问题啊~..rnrnrn//下面是LxClient.java 文件:rnrnimport javax.swing.*;rnimport java.awt.*;rnimport java.awt.event.*;rnrnimport org.apache.axis.client.Call;rnimport org.apache.axis.client.Service;rnimport org.apache.axis.encoding.XMLType;rnimport org.apache.axis.utils.Options;rnrnimport javax.xml.rpc.ParameterMode;rnimport javax.xml.namespace.QName;rnrnpublic class LxClientrn extends JFrame rn JTextField jTextField1 = new JTextField();rn JLabel jLabel3 = new JLabel();rn JLabel jLabel1 = new JLabel();rn JButton jButton1 = new JButton();rn JButton jButton2 = new JButton();rn JButton jButton3 = new JButton();rn JLabel jLabel2 = new JLabel();rn JTextField jTextField2 = new JTextField();rnrn public LxClient() rn try rn jbInit();rn rn catch (Exception e) rn e.printStackTrace();rn rn rnrn public static void main(String args[])rn LxClient myframe=new LxClient();rn myframe.setSize(400,200);rn myframe.setVisible(true);rnrn rnrn private void jbInit() throws Exception rn this.getContentPane().setLayout(null);rn jTextField1.setText("");rn jTextField1.setBounds(new Rectangle(131, 51, 80, 24));rn jLabel3.setText("A0317286 李迅");rn jLabel3.setBounds(new Rectangle(102, 15, 108, 17));rn jLabel1.setText("填入金额:");rn jLabel1.setBounds(new Rectangle(64, 54, 55, 21));rn jButton1.setBounds(new Rectangle(50, 96, 58, 23));rn jButton1.setText("存款");rn jButton1.addActionListener(new LxClient_jButton1_actionAdapter(this));rn jButton2.setBounds(new Rectangle(126, 96, 63, 23));rn jButton2.setText("取款");rn jButton2.addActionListener(new LxClient_jButton2_actionAdapter(this));rn jButton3.setBounds(new Rectangle(205, 94, 81, 24));rn jButton3.setText("查看金额");rn jButton3.addActionListener(new LxClient_jButton3_actionAdapter(this));rn jLabel2.setText("当前的金额:");rn jLabel2.setBounds(new Rectangle(59, 136, 74, 21));rn jTextField2.setEditable(false);rn jTextField2.setText("");rn jTextField2.setBounds(new Rectangle(127, 133, 85, 25));rn this.getContentPane().add(jTextField1, null);rn this.getContentPane().add(jLabel3, null);rn this.getContentPane().add(jLabel1, null);rn this.getContentPane().add(jButton2, null);rn this.getContentPane().add(jButton1, null);rn this.getContentPane().add(jButton3, null);rn this.getContentPane().add(jLabel2, null);rn this.getContentPane().add(jTextField2, null);rn rnrn /***************************************************************************rn 调用WebService* /rn 存款*/rn void jButton1_actionPerformed(ActionEvent e) rn try rn String endpoint = "http://localhost:8080/axis/services/LxAccount";rn String method = "deposit";rn Integer i = Integer.valueOf(jTextField1.getText());rn Service service = new Service();rn Call call = (Call) service.createCall();rnrn call.setTargetEndpointAddress(new java.net.URL(endpoint));rn call.setOperationName(method);rnrn Integer myFund = (Integer) call.invoke(new Object[] i);rn //更新数据rn jTextField2.setText(myFund.toString());rn jLabel1.updateUI();rn rn catch (Exception ex) rn System.err.println(ex.toString());rn rn rn /***************************************************************************rn 取款*/rn void jButton2_actionPerformed(ActionEvent e) rn try rn String endpoint = "http://localhost:8080/axis/services/LxAccount";rn String method = "withdraw";rn Integer i = Integer.valueOf(jTextField1.getText());rn Service service = new Service();rn Call call = (Call) service.createCall();rnrn call.setTargetEndpointAddress(new java.net.URL(endpoint));rn call.setOperationName(method);rnrn Integer myFund = (Integer) call.invoke(new Object[] i);rn //更新数据rn jTextField2.setText(myFund.toString());rn jLabel1.updateUI();rn rn catch (Exception ex) rn System.err.println(ex.toString());rn rn rn /***************************************************************************rn 显示当前金额*/rn void jButton3_actionPerformed(ActionEvent e) rn try rn String endpoint = "http://localhost:8080/axis/services/LxAccount";rn String method = "getAccount";rnrn Service service = new Service();rn Call call = (Call) service.createCall();rnrn call.setTargetEndpointAddress(new java.net.URL(endpoint));rn call.setOperationName(method);rnrn Integer myFund = (Integer) call.invoke(new Object[] );rn //更新数据rn jTextField2.setText(myFund.toString());rn jLabel1.updateUI();rn rn catch (Exception ex) rn System.err.println(ex.toString());rn rn rnrnrnclass LxClient_jButton1_actionAdapterrn implements java.awt.event.ActionListener rn LxClient adaptee;rnrn LxClient_jButton1_actionAdapter(LxClient adaptee) rn this.adaptee = adaptee;rn rnrn public void actionPerformed(ActionEvent e) rn adaptee.jButton1_actionPerformed(e);rn rnrnrnclass LxClient_jButton2_actionAdapterrn implements java.awt.event.ActionListener rn LxClient adaptee;rnrn LxClient_jButton2_actionAdapter(LxClient adaptee) rn this.adaptee = adaptee;rn rnrn public void actionPerformed(ActionEvent e) rn adaptee.jButton2_actionPerformed(e);rn rnrnrnclass LxClient_jButton3_actionAdapterrn implements java.awt.event.ActionListener rn LxClient adaptee;rnrn LxClient_jButton3_actionAdapter(LxClient adaptee) rn this.adaptee = adaptee;rn rnrn public void actionPerformed(ActionEvent e) rn adaptee.jButton3_actionPerformed(e);rn rnrn
怎么又是noclassdeffounderror问题啊
我设置如下rnclasspath=.;C:\study;C:\j2sdk\lib\tools.jar;C:\j2sdk\lib\dt.jar;C:\Tomcat 5.0\common\lib\servlet-api.jarrn机子重新启动过rnjavac c:\study\HelloWorld.java 没问题,但java不行.rnrnHelloWorld.java代码 文件放到c:\study下了.rnpublic class HelloWorldrn public static void main(String[] args)rn System.out.println("hello world");rn rnrnrn
NoClassDefFoundError: oracle/jbo/JboException的问题怎么解决,请高手指点
我用JDeveloper10g将应用程序部署到独立OC4J的过程中老是因为这个导致部署失败.本人刚用JD与OC4J不久,诚请高手指点:这个类是在哪使用的(我在程序中根本就没用到过这个类),以及有什么用途?这个问题应该怎么解决?谢谢!(急~~~~)rnrn以下是部署日志:rn---- Deployment started. ---- 2006-10-13 10:28:51rnTarget platform is 独立 OC4J 10g 10.1.3 (oc4j).rnWrote EJB JAR file to D:\JDeveloper\jdev\mywork\SRDemonew\DataModel\Deployment\ejb1.jarrnWrote WAR file to D:\JDeveloper\jdev\mywork\SRDemonew\UserInterface\Deployment\webapp1.warrnWrote EAR file to D:\JDeveloper\jdev\mywork\SRDemonew\Deployment\Deployment\SRDemoApplication.earrn正在上载文件 SRDemoApplication.ear...rn正在上载文件 SRDemoApplication.ear...rn正在上载文件 SRDemoApplication.ear...rn正在上载文件 SRDemoApplication.ear...rn正在上载文件 SRDemoApplication.ear...rn正在上载文件 SRDemoApplication.ear...rn正在上载文件 SRDemoApplication.ear...rnSRDemoApplication 的 Application Deployer 开始。rn将档案复制到 D:\oc4j\j2ee\home\applications\SRDemoApplication.earrn初始化 D:\oc4j\j2ee\home\applications\SRDemoApplication.ear 开始...rn解压缩 SRDemoApplication.earrn解压缩 SRDemoApplication.ear 完成rn解压缩 webapp1.warrn解压缩 webapp1.war 完成rn初始化 D:\oc4j\j2ee\home\applications\SRDemoApplication.ear 结束...rn启动应用程序: SRDemoApplicationrn初始化类加载程序rn初始化 EJB 容器rn加载连接器rn启动资源适配器rn处理 EJB 模块: ejb1.jarrn编译 EJB 生成的代码rn初始化 EJB 会话rn提交类加载程序rn初始化 webapp1 开始...rn初始化 webapp1 结束...rn已启动的应用程序: SRDemoApplicationrn将 Web 应用程序绑定到站点 default-web-site 开始...rn将应用程序 SRDemoApplication 的 webapp1 Web 模块绑定到上下文根 SRDemonew-UserInterface-context-root 下的站点 default-web-sitern异常错误: NoClassDefFoundError: oracle/jbo/JboExceptionrnOperation failed with error:oracle/jbo/JboExceptionrnrnDeployment failedrnElapsed time for deployment: 1 minute, 22 secondsrn#### Deployment incomplete. #### 2006-10-13 10:30:13rn
android工作空间出错 解决总结
自己自学的android 总是出这样那样的错误 出错多了 处理的经验也就多了 最近有很多人问我怎么处理工作空间出错的问题 我就写了一个总结 和大家分享下
运行server端的servlet时报错NoClassDefFoundError,怎么解决????
root causernrnjava.lang.NoClassDefFoundError: javax/xml/messaging/JAXMServletrnrnrn附源代码:rnimport javax.servlet.ServletConfig;rnimport javax.servlet.ServletException;rnimport javax.xml.messaging.*;rnimport javax.xml.soap.*;rnrnpublic class LilyServlet extends JAXMServlet implements ReqRespListenerrnrn static MessageFactory factory = null;rn staticrn tryrn factory = MessageFactory.newInstance();rn catch(Exception ex)rn ex.printStackTrace();rn rn rnrn /**rn * Returns a list of invoices in the form of a SOAPMessage.rn * @param message Incoming SOAPMessage containing the client's name.rn * @return A SOAPMessage containing a list of invoices.rn */rn public SOAPMessage onMessage(SOAPMessage message) rn System.out.println("Here's the SOAP message that received from a Client: ");rnrn try rn int count = message.countAttachments();rn System.out.println("There are:"+count+"message parts");rnrn System.out.println("Here's the message:");rn message.writeTo(System.out);rnrnrn // Print the incoming messagernrn// message.writeTo(System.out);rn// // SOAPMessage msg = null;rn SOAPMessage msg = factory.createMessage();rn //Create objects for the message partsrn SOAPPart soapPart = msg.getSOAPPart();rn SOAPEnvelope envelope = soapPart.getEnvelope();rn SOAPBody body = envelope.getBody();rn Name name=envelope.createName("Response");rn SOAPBodyElement bodyElement = body.addBodyElement(name);rn bodyElement.addTextNode("This is the response");rn//rn// //Populate the Messagern// StreamSource preppedMsgSrc = new StreamSource(new FileInputStream("prepped.msg"));rn// soapPart.setContent(preppedMsgSrc);rn// //Save the messagern// msg.saveChanges();rn // Create a reply messagern// SOAPMessage msg = factory.createMessage();rn// // Get the SOAP Envelope from the SOAP Partrn// SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();rn// // Get a soap body from the envelope.rn// SOAPBody body = envelope.getBody();rn// // Remove empty header from the Envelopern// envelope.getHeader().detachNode();rn// // Add the Order as Body Elementrn// SOAPBodyElement item = body.addBodyElement(envelope.createName("Order"));rn// // Add a SOAP Attribute with name "JMS" and value of number of Items in the Orderrn// item.addAttribute(envelope.createName("JMS"),"Accepted");rnrn // Return a reply message back to the JAXM clientrn return msg;rn catch(Exception e) rn System.out.println("Error in processing or replying to a message - e: " + e);rn return null;rn rn rnrn /**rn * Creates an instance of a JAXM MessageFactory.rn */rn public void init(ServletConfig config) throws ServletExceptionrn rn super.init(config);rn rnrnrnrn
NoClassDefFoundError错误
//在解释运行程序时发生了一个奇怪的错误----// NoClassDefFoundErrorrn// 请专家们帮我看看 rn/**rn MyColorSliderTest.javarn @author GeHaimingrn @version 2007-04-30rn*/rnrnimport javax.swing.*;rnimport javax.swing.event.*;rnimport java.awt.*;rnimport java.awt.event.*;rnrnpublic class MyColorSliderTestrnrn public static void main(String[] args)rn rn MyColorSliderFrame frame=new MyColorSliderFrame();rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn frame.setVisible(true);rn rnrnrn/**rn MyColorSliderFramern*/rnclass MyColorSliderFrame extends JFramernrn public MyColorSliderFrame()rn rn setTitle("My Color Slider Test");rn setSize(DEFAULT_WIDTH,DEFAULT_HEIGHT);rn rn //初始化暂存颜色的变量rn red=green=blue=256/2;rn rn //sliderPanelrn sliderPanel=new JPanel();rn sliderPanel.setLayout(new GridLayout(3,1));rn rn //事件监听器rn listener=new ChangeListener()rn rn public void stateChanged(ChangeEvent event)rn rn JSlider slider=(JSlider)event.getSource();rn int value=slider.getValue();rn rn //这种算法,我并不是很认同,但又找不到时别的方法了rn if(value!=red)rn rn red=value;rn demoPanel.setBackground(new Color(value,green,blue));rn rn elsern rn if(value!=green)rn rn green=value;rn demoPanel.setBackground(new Color(red,value,blue));rn rn elsern rn blue=value;rn demoPanel.setBackground(new Color(red,green,value));rn rn rn rn ;rn rn //redSliderrn JSlider redSlider=new JSlider(0,256,1);rn addSlider(redSlider,"red");rn rn //greenSliderrn JSlider greenSlider=new JSlider(0,256,1);rn addSlider(greenSlider,"green");rn rn //blueSliderrn JSlider blueSlider=new JSlider(0,256,1);rn addSlider(blueSlider,"blue");rn rn rn //添加Sliderrn public void addSlider(JSlider s,String description)rn rn s.addChangeListener(listener);rn JPanel panel=new JPanel();rn panel.add(s);rn panel.add(new JLabel(description));rn sliderPanel.add(panel);rn rn rn private JPanel demoPanel;rn private JPanel sliderPanel;rn private ChangeListener listener;rn private int red,green,blue;rn rn public static final int DEFAULT_WIDTH=400;rn public static final int DEFAULT_HEIGHT=400;rn rnrn
诡异的NoClassDefFoundError
发生NoClassDefFoundError,有哪些情况啊?rn希望有发生过这个问题的人都说说啊rn rnclasspath绝对没错rnrn我自己电脑上运行的好好的rn拿到别人电脑上运行就出现这个错误rn rn发生过很多次了rn有的人的电脑上我把需要的JAR包放到JBOSS下面的一个LIB目录下后就没有这个问题了rn但是有的还是这个问题rn rn实在搞不清楚这个是什么问题rnrnJAVADOC上是这么写的rn当 Java 虚拟机或 ClassLoader 实例试图在类的定义中加载(作为通常方法调用的一部分或者作为使用 new 表达式创建的新实例的一部分),但无法找到该类的定义时,抛出此异常
helloworld出NoClassDefFoundError错误,盼解决
1.操作rnd:\eclipse\workspace\test\bin\org\company>java HelloWorldrnrn2.源代码rn就是一句HelloWorldrnrn3.异常现象rnException in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong namrne: org/company/HelloWorld)rn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:620)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12rn4)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)rn at java.net.URLClassLoader.access$000(URLClassLoader.java:56)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:195)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:306)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:251)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)rnrn4.环境变量rn[color=#FF0000]CLASSPATH[/color]:.;D:\jdk1.6\lib;D:\jdk1.6\jre\lib;D:\jdk1.6\lib\tools.jar;%ANT_HOME%\lib;D:\jdk1.6\jre\lib\extrn[color=#FF0000]JAVA_HOME[/color]:D:\jdk1.6rn[color=#FF0000]Path[/color]:%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%ANT_HOME%\binrn
记录一次Jetty出现NoClassDefFoundError的解决过程
首先,问题出现在春结后,测试环境的大部分模块都不能使用,报如下错误。 3353394284 [163714][k4oi4rk2kxn1nfyu1] ERROR com.alibaba.dubbo.rpc.filter.ExceptionFilter  -  [DUBBO] Got unchecked and undeclared exception which called by 10.1.20...
idea NoClassDefFoundError: 问题的原因分析和解决
idea NoClassDefFoundError: 问题的原因分析和解决问题的现象:idea NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource 问题的现象:idea NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource 最近学习javaWEB 编...
NoClassDefFoundError:org/apche/digesters/Rileset如何解决?
在启动tomcat服务器的时候控制台报这个错误:rnNoClassDefFoundError:org/apche/digesters/Rilesetrn我不知道哪里出现问题,求指点!谢谢!
NoClassDefFoundError问题
被这个问题困扰很久了rn今天受不了了rnrn为什么在工程里明明已经有那些JAR包,有那些.class了(不是自己加载,是建工程的时候自动生成的)rn但运行的时候还是NoClassDefFoundErrorrnrn这是啥原因啊rn实在搞不懂rnrnrn
NoClassDefFoundError的问题
我做的的是继承自TestCase的测试方法rn昨天晚上我写了个测试方法一,顺利完成了rn今天我另外写了个测试方法二,报错java.lang.NoClassDefFoundErrorrn运行我昨天的 方法一居然也报这个错误?为什么?rnrn另外,还有个很重要的问题,就算报错,myeclipse的console也应该会输出错误啊,为什么是什么都没有呢?只有右下角有个小窗口显示了错误信息?我什么都没有动啊,昨天还可以的rnrn
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法