NoClassDefFoundError for POIXMLTypeLoader

在windows下面下载文件没问题,在linux下在报错如下:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.POIXMLTypeLoader
at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook$Factory.newInstance(Unknown Source)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:425)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:227)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:218)
at com.winning.tplife.core.common.utils.ExcelUtils.makeWorkbook(ExcelUtils.java:117)
在网上看了一些资料 引用了 poi ,poi-ooxml ,dom4j ,poi-ooxml-schemas ,xmlbean,stax-api,jar包,但是还是包同样的错,看日志里面也扫到了这些jar。
我浏览了一下包,找不到任何poixmltypeloader类。这是一个已知的问题吗?有人能回答我吗
谢谢了 帮忙看一下

3个回答

Could not initialize class org.apache.poi.POIXMLTypeLoader;这是找不到类,你要看你的jar包的版本号,poi低版本好像要依赖包,最好用高版本的,
用maven管理jar包吧,我用poi的时候好像记得就导入了两个包吧,你在官网下载看看那几个包

qq_30212947
伍熙吖 这个文章我看了,问题是一样的 但是没人解答。
2 年多之前 回复

感觉jdk版本的问题,确认版本是否一致

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
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?
这个错误是什么意思?
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 表达式创建的新实例的一部分),但无法找到该类的定义时,抛出此异常
NoClassDefFoundError问题
被这个问题困扰很久了rn今天受不了了rnrn为什么在工程里明明已经有那些JAR包,有那些.class了(不是自己加载,是建工程的时候自动生成的)rn但运行的时候还是NoClassDefFoundErrorrnrn这是啥原因啊rn实在搞不懂rnrnrn
NoClassDefFoundError的问题
我做的的是继承自TestCase的测试方法rn昨天晚上我写了个测试方法一,顺利完成了rn今天我另外写了个测试方法二,报错java.lang.NoClassDefFoundErrorrn运行我昨天的 方法一居然也报这个错误?为什么?rnrn另外,还有个很重要的问题,就算报错,myeclipse的console也应该会输出错误啊,为什么是什么都没有呢?只有右下角有个小窗口显示了错误信息?我什么都没有动啊,昨天还可以的rnrn
又是NoClassDefFoundError
最近做eclipse插件项目,用到apache的common-net包,用以连接ftp,rn我单独运行它(写个测试类,在main函数中直接调用测试)没有问题,但是在eclipse插件运行同样的代码(如菜单事件来调用)则有NoClassDefFoundError,发现是被EventTable(EventDispatcher??)给截获的,然后报的错,为什么好端端的代码放到插件中跑就不行了呢...郁闷中rnrn用的是commons-net-1.4.1.jar,放到refrenced lib中了rnrn谢谢各位了先
程序执行 NoClassDefFoundError !!!
问题在 http://bbs.csdn.net/topics/390671115 这里,求救了,作业还没做完[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/40.gif][/img]。
求助NoClassDefFoundError
java.lang.NoClassDefFoundError rn 初学请大家多帮助。 rnJAVA文件编译成功,但执行出错。 rn环境变量设置是正确的 。 rnjava原文件如下: rnimport javax.swing.JFrame; rnimport java.awt.Image; rnimport java.awt.Toolkit; rnimport java.awt.Dimension; rnrnclass SampleJFrame extends JFrame rn SampleJFrame() rn rn super("Java 示例"); rn setSize(500,300); rn setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); rn setResizable(false); rn Image Icon; rn Toolkit tkit=Toolkit.getDefaultToolkit(); rn Icon=tkit.getImage("D:\\ptest\\1.gif"); rn setIconImage(Icon); rn Dimension screenSize=tkit.getScreenSize(); rn Dimension framsize=this.getSize(); rn if(framsize.height>screenSize.height) rn framsize.height=screenSize.height; rn if(framsize.width>screenSize.width) rn framsize.width=screenSize.width; rn this.setLocation((screenSize.width-framsize.width)/2,(screenSize.height-framsize.height)/2); rn setVisible(true); rn rn public static void main(String[] args) rn rn try rn SampleJFrame sjf=new SampleJFrame(); rn rn catch(Exception e) rn rn rn rn编译显示出下 rnD:\ptest\java>javac SimpleJFrame.java rnrnD:\ptest\java>java SimpleJFrame rnException in thread "main" java.lang.NoClassDefFoundError: SimpleJFrame rnrnrn请大家多多帮助。 rn rn
环信demo报NoClassDefFoundError
[img=https://img-bbs.csdn.net/upload/201510/12/1444631742_607635.png][/img]rn接入环信,在家里试的时候还是好好的,可是到了公司,不管怎么弄都报这个错误。网上查了半天实在是没辙了。跪求大神解救!!
springboot 偶发性的NoClassDefFoundError错误
几天前线上环境springboot出现了NoClassDefFoundError错误,重启之后就没有问题了,请问这种问题的出现,是打包问题吗?rnrn```rn2019-04-16 17:06:04,641 ERROR [https-jsse-nio-10089-exec-2] c.n.m.a.GlobalExceptionHandler [GlobalExceptionHandler.java : 58] 错误信息: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrnorg.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.nes.mtpf.filter.RecordIpFilter.doFilter(RecordIpFilter.java:48)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.nes.mtpf.filter.HttpRequestMethodFilter.doFilter(HttpRequestMethodFilter.java:29)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.nes.mtpf.filter.CorsResponseFilter.doFilter(CorsResponseFilter.java:27)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rnCaused by: java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)rn at com.sun.proxy.$Proxy83.insert(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)rn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)rn at com.sun.proxy.$Proxy109.insertSelective(Unknown Source)rn at com.nes.mtpf.service.impl.ArticleInfoServiceImpl.addNewInfo(ArticleInfoServiceImpl.java:58)rn at com.nes.mtpf.controller.ArticleInfoController.addNewInfo(ArticleInfoController.java:48)rn at sun.reflect.GeneratedMethodAccessor817.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)rn ... 58 common frames omittedrn2019-04-16 17:06:13,863 ERROR [https-jsse-nio-10089-exec-7] c.n.m.a.GlobalExceptionHandler [GlobalExceptionHandler.java : 58] 错误信息: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrnorg.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.nes.mtpf.filter.RecordIpFilter.doFilter(RecordIpFilter.java:48)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.nes.mtpf.filter.HttpRequestMethodFilter.doFilter(HttpRequestMethodFilter.java:29)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.nes.mtpf.filter.CorsResponseFilter.doFilter(CorsResponseFilter.java:27)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rnCaused by: java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)rn at com.sun.proxy.$Proxy83.insert(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)rn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)rn at com.sun.proxy.$Proxy109.insertSelective(Unknown Source)rn at com.nes.mtpf.service.impl.ArticleInfoServiceImpl.addNewInfo(ArticleInfoServiceImpl.java:58)rn at com.nes.mtpf.controller.ArticleInfoController.addNewInfo(ArticleInfoController.java:48)rn at sun.reflect.GeneratedMethodAccessor817.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)rn ... 58 common frames omittedrn2019-04-16 17:06:15,047 ERROR [http-nio-10088-exec-5] o.a.coyote.http11.Http11Processor [DirectJDKLog.java : 182] Error processing requestrnjava.lang.NoClassDefFoundError: org/apache/tomcat/util/http/parser/Cookiern at org.apache.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader(Rfc6265CookieProcessor.java:90)rn at org.apache.catalina.connector.Request.parseCookies(Request.java:3104)rn at org.apache.catalina.connector.Request.getServerCookies(Request.java:2174)rn at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007)rn at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:714)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rnCaused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.http.parser.Cookiern at java.net.URLClassLoader.findClass(URLClassLoader.java:382)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:424)rn at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:357)rn ... 15 common frames omittedrn2019-04-16 17:06:45,028 ERROR [http-nio-10088-exec-6] o.a.coyote.http11.Http11Processor [DirectJDKLog.java : 182] Error processing requestrnjava.lang.NoClassDefFoundError: org/apache/tomcat/util/http/parser/Cookiern at org.apache.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader(Rfc6265CookieProcessor.java:90)rn at org.apache.catalina.connector.Request.parseCookies(Request.java:3104)rn at org.apache.catalina.connector.Request.getServerCookies(Request.java:2174)rn at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007)rn at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:714)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rn2019-04-16 17:06:51,852 ERROR [http-nio-10088-exec-9] o.a.coyote.http11.Http11Processor [DirectJDKLog.java : 182] Error processing requestrnjava.lang.NoClassDefFoundError: org/apache/tomcat/util/http/parser/Cookiern at org.apache.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader(Rfc6265CookieProcessor.java:90)rn at org.apache.catalina.connector.Request.parseCookies(Request.java:3104)rn at org.apache.catalina.connector.Request.getServerCookies(Request.java:2174)rn at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007)rn at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:714)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rn2019-04-16 17:07:00,001 ERROR [pool-2-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler [TaskUtils.java : 95] Unexpected error occurred in scheduled task.rnjava.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)rn at com.sun.proxy.$Proxy83.selectList(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)rn at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)rn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)rn at com.sun.proxy.$Proxy92.getOffTimingTask(Unknown Source)rn at com.nes.mtpf.service.impl.EquipmentTimeWorkInfoServiceImpl.handleTimingTask(EquipmentTimeWorkInfoServiceImpl.java:126)rn at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)rn at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)rn at com.sun.proxy.$Proxy100.handleTimingTask(Unknown Source)rn at com.nes.mtpf.AppStart.handleTimingTask(AppStart.java:148)rn at sun.reflect.GeneratedMethodAccessor247.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)rn at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)rn at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at java.lang.Thread.run(Thread.java:748)rn2019-04-16 17:08:00,001 ERROR [pool-2-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler [TaskUtils.java : 95] Unexpected error occurred in scheduled task.rnjava.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtilrn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)rn at com.sun.proxy.$Proxy83.selectList(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)rn at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)rn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)rn at com.sun.proxy.$Proxy92.getOffTimingTask(Unknown Source)rn at com.nes.mtpf.service.impl.EquipmentTimeWorkInfoServiceImpl.handleTimingTask(EquipmentTimeWorkInfoServiceImpl.java:126)rn at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)rn at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)rn at com.sun.proxy.$Proxy100.handleTimingTask(Unknown Source)rn at com.nes.mtpf.AppStart.handleTimingTask(AppStart.java:148)rn at sun.reflect.GeneratedMethodAccessor247.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)rn at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)rn at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at java.lang.Thread.run(Thread.java:748)rn2019-04-16 17:08:36,579 ERROR [http-nio-10088-exec-4] o.a.coyote.http11.Http11Processor [DirectJDKLog.java : 182] Error processing requestrnjava.lang.NoClassDefFoundError: org/apache/tomcat/util/http/parser/Cookiern at org.apache.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader(Rfc6265CookieProcessor.java:90)rn at org.apache.catalina.connector.Request.parseCookies(Request.java:3104)rn at org.apache.catalina.connector.Request.getServerCookies(Request.java:2174)rn at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007)rn at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:714)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rn2019-04-16 17:08:44,132 ERROR [http-nio-10088-exec-10] o.a.coyote.http11.Http11Processor [DirectJDKLog.java : 182] Error processing requestrnjava.lang.NoClassDefFoundError: org/apache/tomcat/util/http/parser/Cookiern at org.apache.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader(Rfc6265CookieProcessor.java:90)rn at org.apache.catalina.connector.Request.parseCookies(Request.java:3104)rn at org.apache.catalina.connector.Request.getServerCookies(Request.java:2174)rn at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007)rn at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:714)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:748)rnrn```
对NoClassDefFoundError疑惑
我是用Eclipse做开发的,已经导入了SonyEricssion的模拟器,但当我用诺基亚的FullCanvas时,就报“java.lang.NoClassDefFoundError: GameCanvas: com/nokia/mid/ui/FullCanvas”,如果不继承这个包就没事,我用诺基亚的Sound包是没问题的。rn 不知道是不是包有问题,但是编译时是没报错的,就运行模拟器时才报错。如果有人也遇到过跟我一样的问题,就来讨论下吧。
NoClassDefFoundError vs ClassNotFoundException
java.lang.NoClassDefFoundError: javax/mail/AuthenticatorrnrnNoClassDefFoundError vs ClassNotFoundException2者有什么区别?rn什么时候会出现NoClassDefFoundError ?
偶发性NoClassDefFoundError,盼解答
做SSO,用户通过portal打开gui客户端,多次登录过程中,发现三个用户同时通过portal登录20次左右,会有一个用户出现java.lang.NoClassDefFoundError错误,登录失败.客户使用的客户端环境没有变化过,不明白为什么会出现这种,网上查,都是直接报这个错的问题的,没发现有偶发报这种错误的情况,请教大家~
NoClassDefFoundError的一个解决方法
用Volley的时候出了一个这样的错误:java.lang.NoClassDefFoundError: com.android.volley.toolbox.Volley 开始以为是.jar包下载不完整导致的,换了几个还是同样的错误。后来看到了adt-17中jar包build path问题,我的开发环境恰好就是17,链接的地址如下: http://android.foxykeep.com/
NoClassDefFoundError错误发现(之一)
这个错与是类加载器中defineClass()方法抛出来的,通过自定义实现加载器发现,如果defineClass方法中的name,不是类名,而是package+类名的形式,例如class文件:test.class,全限定名:com.wyp12.myClassLoader.test,如果加载过程中,如果参数name出错,就会报NoClassDefFoundError错误
一个NoClassDefFoundError的解决过程
内含分析过程,如寻找答案,直接查看解决方式。 今天在android studio项目内添加了几个jar包之后突然项目就跑不起来了,直接崩溃。在logcat看日志,报错信息如下: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.san.bili, PID: 31934 java.la...
请问NoClassDefFoundError问题
我在Eclipse下编译代码的时候出现了如下错误rn rnjava.lang.NoClassDefFoundError: org/eclipse/core/runtime/ISafeRunnablern at wdx.treeviewer.test.TreeViewer1.open(TreeViewer1.java:41)rn at wdx.treeviewer.test.TreeViewer1.main(TreeViewer1.java:26)rnException in thread "main" rn rn请问这可能是什么原因引起的啊?rn在编译另外一个工程的时候也出现了这个错误rn谢谢
求救!关于NoClassDefFoundError的错误提示
DOS下输入rnjavac simpletest.javarn提示rnjava.lang.NoClassDefFoundError: java/util/ArrayListrn at sun.tools.util.CommandLine.parse(Compiled Code)rn at sun.tools.javac.Main.compile(Compiled Code)rn at sun.tools.javac.Main.main(Main.java:729)rn请问这是怎么回事?rn我倒腾了好长时间的classpath也没有搞定rn郁闷!rn求救!rnrn
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
NoClassDefFoundError是怎么回事?
一直都是用的Eclipse写程序的,没想到今天试了一下命令行运行java居然失败了,错误是:Exception in thread "main" java.lang.NoClassDefFoundError:也是调试通过,不能执行rn查过,环境变量都设置正确,classpath也确实有.; 而且我在classpath中加入当前路径查找也不成功,实在是不知道怎么回事了。。。
spring aop :NoClassDefFoundError
自己搭建了SSh框架,没有加入aop前,还行,挺好的。rnrn一加入AOP,启动时就报错;rnjava.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrnrn在网上找了个Jar包:aopalliance-alpha1.jar,然后又报另一个错:rnnested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advicernrn我晕了,存在这个类么?网上也没有解决方案。rn我的配置:[code=XML]rn rn rn rn classpath*:config/properties/jdbc.propertiesrn rn rn rn rn rnrnrn rnrn rn rn jdbc:mysql://localhost:3306/testrn rn rn rootrn rn rn mysqlrn rn rn rnrnrnrn rnrn rn rn rn rn org.hibernate.dialect.MySQLInnoDBDialectrn truern nonern truern threadrnrn rn 20rn rn 2rn rn 120rn rn 100rn rn 120rn rn 2rn rn truernrn rn rn rn rn rn rn rnrn rn rn rn rnrnrnrnrn rn rn rn rn rn rnrn rn rnrn rnrn rn rnrnrn rn rn rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rnjar包:[img=http://s2.sinaimg.cn/middle/4ffe4d86h9fe73bf7aee1&690][/img]
请问:package 和 NoClassDefFoundError
本行是C++,老是不会用java的package,能帮我瞧瞧吗?rn是这样的:rn// j:\java\test\Base.javarnpackage java.test;rnpublic class Base rnpublic Base() system.out.print("base");rnrn// j:\java\test\Derived.javarnpackage java.test;rnpublic class Derived extends Base rnpublic Derived() System.out.println("derived");rnrn系统的CLASSPATH = J:;//等等rn结果,两个文件在j:\java下都可以编译:rnJ:\java> javac base.javarnJ:\java> javac derived.javarn但是:rnJ:\java> java base 和java derived就会报NoClassDefFoundError的错rn能告诉我应该怎么设置吗?Thanks.
jaxp的迷惑!! NoClassDefFoundError!
非常迷惑,因为不知原因何在!!rnrn首先声明:我的运行环境是j2sdk1.4.0,换言之是包含了jaxp的了rn在程序中,我调用了两个类rnimport javax.xml.parsers.DocumentBuilder;rnimport javax.xml.parsers.DocumentBuilderFactory;rnrn但在运行中,却出现这样的提示错误:rnException in thread "main" java.lang.NoClassDefFoundError: javax/xml/parsers/DocumentBuilderFactoryrnrn我检查了很多遍了,都不知道原因何在! 我的jdk路径设置没有错误,因为不需要用到jaxp的程序都能运行。rnrn救命!~~~
莫名其妙的 NoClassDefFoundError,谁知道啊?
JDK版本1.4.0,出现了如下错误:rnException in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/ErrorHandrnlerrn at myClass2.(myClass2.java:69)rn at myClass1.main(myClass1.java:21)rnrn谁知道怎么回事?rn
初学者的问题,noclassdeffounderror,
先安装jbuilder7(jdk1.3.1),一切正常;rn后安装j2se1.3.1;设置了path="c:\jdk......;...;..."rnclasspath="c:\jdk\...;"听说要加".",就加了rn可是用命令行java xxx.class总是报noclassdeffounderror...rn可以用命令行编译jbuilder7开发好的.jar却可以,困惑啊
一个关于NoClassDefFoundError的问题?
偶在安装RIO,在到了最后一步运行rio viewer的时候,出现了如下的错误:rnException in thread "main" java.lang.NoClassDefFoundError:Files\jini2_1\lib\jsk-platform/jar;rn所以rio viewer就启动不起来了,请高手指教如何解决,非常感谢!!!
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出现的一个原因
只知道一个,有可能是jar包冲突。 如果遇到这个错误的话可以考虑一下有没有这种可能。
NoClassDefFoundError 的一种错误原因
工具ieda,需要外部添加jar包的时候如下图这样添加 然后进行编译是没有问题的,但运行的时候访问就会报错,最终找到的原因,可能是这种添加jar导致打包后的项目里面没有相关的jar包 如图: 里面找不到 解决办法,可以将相关jar包打入maven库中 mvninstall:install-file-Dfile=xxx.jar-DgroupId=xxx -DartifactId...
weblogic11g部署项目出现NoClassDefFoundError
具体错误如下:rnException preparing module: EJBModule(DaoEjb) Unable to deploy EJB: E:\Program Files\wls1035_dev\user_projects\domains\base_domain\applications\DaoEjb.jar from DaoEjb.jar: [EJB:010229]EJB : DaoEjb .Unable to initialize method info for remote ,home , message listener or webservice endpoint interface. The error is java.lang.NoClassDefFoundError: org/jdom/Documentrn这个问题是jdom这个jar没有找到,然后我在startWeblogic.cmd里配置了lib_path设置到那个jar,它还是找不到,求解答,我是weblogic新手!rn我的是EJB项目,这是部署EJB jar包时候出现的问题!
new ActiveMQConnectionFactory报错:NoClassDefFoundError
代码内容如下:rnurlconf="failover:(tcp://192.169.177.179:61616)?maxReconnectDelay=1000&timeout=1000";rn conFactory = new ActiveMQConnectionFactory(urlconf);rnlogger.info("消息总线--消息服务器地址:" + urlconf);rn报错信息如下:rnorg.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/activemq/ActiveMQConnectionFactoryrn at com.sgcc.uap.kernel.spring.ModuleWebDispatcher.doDispatch(ModuleWebDispatcher.java:185) ~[com.sgcc.uap.kernel_1.5.0.v201307251036.jar:?]rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) ~[servlet-api.jar:?]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) ~[servlet-api.jar:?]rn at com.sgcc.uap.kernel.web.adaptor.ModuleServletAdaptor.service(ModuleServletAdaptor.java:80) ~[com.sgcc.uap.kernel_1.5.0.v201307251036.jar:?]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) ~[servlet-api.jar:?]rn at com.sgcc.uap.kernel.httpservice.internal.ServletRegistration.doHandleRequest(ServletRegistration.java:170) ~[com.sgcc.uap.kernel.httpservice_1.5.0.v201307251036.jar:?]rn at com.sgcc.uap.kernel.httpservice.internal.AbstractRegistration.handleRequest(AbstractRegistration.java:58) ~[com.sgcc.uap.kernel.httpservice_1.5.0.v201307251036.jar:?]rn at com.sgcc.uap.kernel.httpservice.internal.ProxyServlet.processRequest(ProxyServlet.java:344) [com.sgcc.uap.kernel.httpservice_1.5.0.v201307251036.jar:?]rn at com.sgcc.uap.kernel.httpservice.internal.ProxyServlet.service(ProxyServlet.java:174) [com.sgcc.uap.kernel.httpservice_1.5.0.v201307251036.jar:?]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:?]rn at com.sgcc.uap.kernel.web.server.UapModuleContextServlet.service(UapModuleContextServlet.java:169) [com.sgcc.uap.kernel.web_1.0.0.jar:?]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:?]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:?]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:?]rn at com.sgcc.uap.kernel.web.server.UapModuleContextFilter$FilterChainImpl.doFilter(UapModuleContextFilter.java:189) [com.sgcc.uap.kernel.web_1.0.0.jar:?]rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [org.springframework_3.1.1.RELEASE.jar:?]rn at com.sgcc.uap.kernel.web.server.UapModuleContextFilter$FilterChainImpl.doFilter(UapModuleContextFilter.java:183) [com.sgcc.uap.kernel.web_1.0.0.jar:?]rn at com.sgcc.uap.kernel.web.server.UapModuleContextFilter.doFilter(UapModuleContextFilter.java:108) [com.sgcc.uap.kernel.web_1.0.0.jar:?]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:?]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:?]rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:?]rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:?]rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) [catalina.jar:?]rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:?]rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:?]rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) [catalina.jar:?]rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) [tomcat-coyote.jar:?]rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) [tomcat-coyote.jar:?]rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) [tomcat-coyote.jar:?]rn at java.lang.Thread.run(Thread.java:662) [?:1.6.0_24]rnCaused by: java.lang.NoClassDefFoundError: org/apache/activemq/ActiveMQConnectionFactoryrn at com.nari.mqdata.mqdata.bizc.MqdataBizc.create(MqdataBizc.java:484) ~[bundlefile/:?]rn at com.nari.mqdata.mqdata.bizc.MqdataBizc.receiveMQ(MqdataBizc.java:294) ~[bundlefile/:?]rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_24]rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_24]rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_24]rn at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_24]rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at com.sgcc.uap.bizc.interceptor.BizLogicInterceptor.invoke(BizLogicInterceptor.java:41) ~[com.sgcc.uap.core.bizc_1.5.0.v201307251037.jar:?]rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at $Proxy223.receiveMQ(Unknown Source) ~[?:?]rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_24]rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_24]rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_24]rn at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_24]rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at com.sgcc.uap.monitor.interceptor.BizcInterceptor.invoke(BizcInterceptor.java:47) ~[com.sgcc.uap.core.monitor_1.5.0.v201307251037.jar:?]rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at $Proxy223.receiveMQ(Unknown Source) ~[?:?]rn at com.nari.mqdata.mqdata.MqdataController.insertjkdata(MqdataController.java:60) ~[bundlefile/:?]rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_24]rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_24]rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_24]rn at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_24]rn at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) ~[org.springframework_3.1.1.RELEASE.jar:?]rn at com.sgcc.uap.kernel.spring.ModuleWebDispatcher.doDispatch(ModuleWebDispatcher.java:148) ~[com.sgcc.uap.kernel_1.5.0.v201307251036.jar:?]rn ... 33 morern
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
Error preverifying class ..... NoClassDefFoundError:
[color=#FF0000]在一个J2ME项目中(里边有jre和j2me的jar包),本人的一段程序可以正常运行,但是在Eclipse中却总是有红色的错误提示如图:[/color]rnrnrn[img=http://hi.csdn.net/attachment/200911/25/45597_12591168302t2I.jpg][/img]rnrnrn[color=#FF0000]具体错误提示为:Error preverifying class example.ImageFileFilter java/lang/rn NoClassDefFoundError: javax/swing/filechooser/FileFilter[/color]rnrnrnrn程序代码如下:rn[code=Java]rnpackage example;rnrnimport java.io.*;rnimport java.net.URL;rnimport javax.swing.*;rnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.imageio.*;rnimport jp.sourceforge.qrcode.codec.*;rnimport jp.sourceforge.qrcode.codec.data.QRCodeImage;rnimport jp.sourceforge.qrcode.codec.exception.DecodingFailedException;rnimport jp.sourceforge.qrcode.codec.util.*;rnimport javax.swing.filechooser.FileFilter;rnrnimport jp.sourceforge.qrcode.codec.geom.Line;rnimport jp.sourceforge.qrcode.codec.geom.Point;rnrnimport java.awt.Canvas;rnimport java.awt.Color;rnimport java.awt.Graphics;rnimport java.awt.Graphics2D;rnimport java.awt.image.BufferedImage;rnrn// Example of GUI QRCode reader applicationrnrnpublic class QRCodeDecoderGUIExample extends JFrame implements ActionListener rn JMenuBar menuBar;rn JMenu fileMenu;rn JMenuItem openMenu;rn JTextField url;rn JButton button;rn JFileChooser chooser;rn BufferedImage sourceImage;rn JLabel sourceImageLabel;rn J2SEDebugCanvas canvas;rn JTextArea decodedText;rn static final long serialVersionUID = 1;rn rn class J2SEImage implements QRCodeImage rn BufferedImage image;rnrn public J2SEImage(BufferedImage image) rn this.image = image;rn rnrn public int getWidth() rn return image.getWidth();rn rn rn public int getHeight() rn return image.getHeight();rn rnrn public int getPixel(int x, int y) rn return image.getRGB(x, y);rn rn rn rn QRCodeDecoderGUIExample() rn System.out.println("Starting QRCode Decoder GUI Example ...");rn setSize(400,400);rn setDefaultCloseOperation(EXIT_ON_CLOSE);rn menuBar = new JMenuBar();rn openMenu = new JMenuItem("Open Image");rn openMenu.addActionListener(this);rn menuBar.add(openMenu);rn setJMenuBar(menuBar);rn url = new JTextField(20);rn url.setText("(Or input image url here.)");rn button = new JButton("Open from URL");rn button.addActionListener(this);rn JPanel urlPanel = new JPanel();rn urlPanel.add(url);rn urlPanel.add(button);rn button = new JButton("URL");rn getContentPane().add(urlPanel, BorderLayout.NORTH);rn chooser = new JFileChooser("Open QR Code Image");rn chooser.setFileFilter(new ImageFileFilter());rn setLocation(300, 200);rn url.select(0, url.getText().length());rn setVisible(true);rn rn rn public void actionPerformed(ActionEvent event) rn if (event.getSource().equals(openMenu)) rn chooser.showOpenDialog(this);rn if (chooser.getSelectedFile() == null)rn return ;rn try rn sourceImage = ImageIO.read(chooser.getSelectedFile());rn catch (Exception e) rn e.printStackTrace();rn rn rn else if (event.getActionCommand().equals("Open from URL")) rn try rn sourceImage = ImageIO.read(new URL(url.getText()));rn catch (Exception e) rn e.printStackTrace();rn rn rn rn elsern return;rn rn if (sourceImageLabel != null)rn getContentPane().remove(sourceImageLabel);rn rn sourceImageLabel = new JLabel(new ImageIcon(sourceImage));rn getContentPane().add(sourceImageLabel, BorderLayout.WEST);rn rnrn QRCodeDecoder decoder = new QRCodeDecoder();rn if (canvas != null) rn getContentPane().remove(canvas);rn //canvas.setImage(null);rn rn canvas = new J2SEDebugCanvas();rn QRCodeDecoder.setCanvas(canvas);rn getContentPane().add(canvas, BorderLayout.EAST);rn String decodedString = null;rn try rn decodedString = new String(decoder.decode(new J2SEImage(sourceImage)));rn catch (DecodingFailedException e) rn canvas.println(e.getMessage());rn canvas.println("--------");rn return;rn rn decodedString = ContentConverter.convert(decodedString);rn canvas.println("\nDecode result:");rn canvas.println(decodedString);rn canvas.println("--------");rn if (decodedText != null)rn getContentPane().remove(decodedText);rn decodedText = new JTextArea(decodedString);rn decodedText.setLineWrap(true);rn decodedText.setRows(decodedString.length() / 20 + 1);rn if (decodedString.length() < 20)rn decodedText.setColumns(decodedString.length());rn elsern decodedText.setColumns(20);rn //decodedText.setSize(sourceImageLabel.getSize().width,100);rn getContentPane().add(decodedText, BorderLayout.SOUTH);rn pack();rn rn public static void main(String[] args) rn new QRCodeDecoderGUIExample();rn rnrnrnrnclass ImageFileFilter extends FileFilter rn String[] acceptExtendsions = "jpg","jpeg","gif","png";rnrn public String getDescription() rn return "QR Code Image files (*.jpg,*.png,*.gif,*.png)";rn rn public boolean accept(File f) rn if (f.isDirectory()) rn return true;rn rn String extension = getExtension(f);rn if (extension == null)rn return true;rn for (int i = 0; i < acceptExtendsions.length; i++) rn if (extension.equals(acceptExtendsions[i]))rn return true;rn rn return false;rn rn rn rn String getExtension(File f) rn String ext = null;rn String s = f.getName();rn int i = s.lastIndexOf('.');rnrn if (i > 0 && i < s.length() - 1) rn ext = s.substring(i+1).toLowerCase();rn rn return ext;rn rnrnrnrnclass J2SEDebugCanvas extends Canvas implements DebugCanvas rn rn private static final long serialVersionUID = 5549214846671001545L;rn BufferedImage image;rn public void setFontColor(int color);rnrn public void paint(Graphics g)rn if (image != null)rn g.drawImage(image, 0, 0, java.awt.Color.WHITE, null);rn rn rn public void println(String string)rn System.out.println(string);rn rn rn public void drawMatrix(boolean[][] matrix) rn if (image == null) rn image = new BufferedImage(matrix.length, matrix[0].length, BufferedImage.TYPE_INT_ARGB);rn setSize(matrix.length, matrix[0].length);rn rn Graphics2D g2d = image.createGraphics();rn g2d.setColor(java.awt.Color.WHITE);rn int width = getWidth();rn for (int x = 0; x < matrix.length; x++) rn g2d.drawLine(x, 0, x, width);rn rn g2d.setColor(java.awt.Color.BLACK);rn for (int x = 0; x < matrix.length; x++) rn for (int y = 0; y < matrix[0].length; y++) rn if (matrix[x][y] == true)rn g2d.drawLine(x, y, x, y);rn rn rn repaint();rn rnrn public void drawLine(Line line, int color)rn Graphics2D g2d = image.createGraphics();rn g2d.setColor(new Color(color));rn g2d.drawLine(line.getP1().getX(), line.getP1().getY(),rn line.getP2().getX(), line.getP2().getY());rn repaint();rn rnrn public void drawLines(Line[] lines, int color)rn Graphics2D g2d = image.createGraphics();rn g2d.setColor(new Color(color));rn for (int i = 0; i < lines.length; i++) rn g2d.drawLine(lines[i].getP1().getX(), lines[i].getP1().getY(),rn lines[i].getP2().getX(), lines[i].getP2().getY());rn rn repaint();rn rn rn public void drawPolygon(Point[] points, int color)rn Graphics2D g2d = image.createGraphics();rn g2d.setColor(new Color(color));rn int numPoints = points.length;rn int[] polygonX = new int[numPoints];rn int[] polygonY = new int[numPoints];rn for (int i = 0; i < numPoints; i++) rn polygonX[i] = points[i].getX();rn polygonY[i] = points[i].getY();rn rn g2d.drawPolygon(polygonX, polygonY, numPoints);rn repaint();rn rnrn public void drawPoints(Point[] points, int color)rn Graphics2D g2d = image.createGraphics();rn g2d.setColor(new Color(color));rn for (int i = 0; i < points.length; i++)rn g2d.drawLine(points[i].getX(), points[i].getY(),points[i].getX(), points[i].getY());rn repaint();rnrn rnrnrn public void drawPoint(Point point, int color)rn Graphics2D g2d = image.createGraphics();rn g2d.setColor(new Color(color));rn g2d.drawLine(point.getX(), point.getY(),point.getX(), point.getY());rn repaint();rnrn rnrn public void drawCross(Point point, int color)rn int x = point.getX();rn int y = point.getY();rnrn Line[] lines = rn new Line(x - 5, y-1, x + 5, y-1),new Line(x-1, y - 5, x-1 ,y + 5),rn new Line(x - 5, y+1, x + 5, y+1),new Line(x+1, y - 5, x+1 ,y + 5),rn new Line(x - 5, y, x + 5, y),new Line(x, y - 5, x ,y + 5)rn ;rn drawLines(lines, color);rn rn public BufferedImage getImage() rn return image;rn rn public void setImage(BufferedImage image) rn this.image = image;rn rnrnrn[/code]rnrn顺便说一下CSDN实在是有点垃圾,发个贴想传个图片都麻烦得要死,传到相册里的图片都被压缩得不成样子了。要不是这里高手多,我早就注销掉CSDN号了。CSDN再不改进,我以后肯定注销掉,找别的社区。
netbeans调试抛出NoClassDefFoundError
netbeans中简单的调试,在文件中点击右键,选择调试文件,结果报错rnrndebug-selected-file-in-java:rnjava.lang.NoClassDefFoundError: com/test/sendEmail/SendProdMonReportrnException in thread "main" Java Result: 1rn成功生成(总时间:1 秒)rnrnrn请问如何配置?多谢了
运行selenium2出现NoClassDefFoundError
下载了selenium2alpha4版本,是一个zip包,解开后是一些jar文件,因为需要在classpath设置这些文件,所以编写了一个cmd文件:rn==================rnset java_home=C:\Program Files\Java\jre6rnrnset classpath=.;selenium-server-2.0a4.jar;ant-1.6.5.jar;bcprov-jdk15-135.jar;commons-codec-1.4.jar;commons-collections-3.2.1.jar;commons-httpclient-3.1.jar;commons-io-1.4.jar;commons-lang-2.4.jar;[color=#FF0000]commons-logging-1.1.1.jar[/color];cssparser-0.9.5.jar;google-collect-1.0.jar;hamcrest-all-1.1.jar;htmlunit-2.7.jar;htmlunit-core-js-2.7.jar;jmock-2.4.0.jar;jmock-junit3-2.4.0.jar;jna.jar;json-20080701.jar;junit-3.8.1.jar;mx4j-tools-3.0.1.jar;nekohtml-1.9.14.jar;sac-1.3.jar;serializer-2.7.1.jar;servlet-api-2.5-6.1.9.jar;xalan-2.7.1.jar;xercesImpl-2.9.1.jar;xml-apis-1.3.04.jarrnrn"%java_home%\bin\java" -jar selenium-server-2.0a4.jarrn==================rn运行后报错:rnException in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClassCond(Unknown Source)rn at java.lang.ClassLoader.defineClass(Unknown Source)rn at java.security.SecureClassLoader.defineClass(Unknown Source)rn at java.net.URLClassLoader.defineClass(Unknown Source)rn at java.net.URLClassLoader.access$000(Unknown Source)rn at java.net.URLClassLoader$1.run(Unknown Source)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(Unknown Source)rn at java.lang.ClassLoader.loadClass(Unknown Source)rn at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)rn at java.lang.ClassLoader.loadClass(Unknown Source)rn at org.openqa.selenium.server.InjectionHelper.(InjectionHelper.java:21)rn at org.openqa.selenium.server.SeleniumServer.checkArgsSanity(SeleniumServer.java:642)rn at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:194)rnCaused by: [color=#FF0000]java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory[/color]rn at java.net.URLClassLoader$1.run(Unknown Source)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(Unknown Source)rn at java.lang.ClassLoader.loadClass(Unknown Source)rn at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)rn at java.lang.ClassLoader.loadClass(Unknown Source)rn ... 15 morernrn可是commons-logging-1.1.1.jar中明明有org.apache.commons.logging.LogFactory这个类(接口)啊!rn
简单的JAVA程序NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: draw rn是什么意思??rnrnclass draw rn public static void main(String[] args) rn Table tw = new Table();rn tw.width = "200";rn tw.height = "300";rn tw.color = "red";rn System.out.println( tw.getName() );rn rnrnrnabstract class graph rn String color;rn graph()rn color = new String("white");rn rn abstract String getName();rnrnrnclass Table extends graph rn String width;rn String height;rn Table()rn width = new String("0"); rn height = new String("0");rn rn String getName()rn return "Table";rn rnrnrn
NoClassDefFoundError怎么解决
我在dos下直接用java Hellorn却出现了java.lang.NoClassDefFoundError:Hello的错误,但是在IDE中运行却没有问题,rn这是怎么回事?
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件