博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
dom4j使用selectSingleNode方法报错
阅读量:6161 次
发布时间:2019-06-21

本文共 5799 字,大约阅读时间需要 19 分钟。

我有一段代码,使用dom4j 正则表达式解析gml , 代码如下:

List
featureMembers= root.selectNodes("featureMember");

发生以下异常:

java.lang.NoClassDefFoundError: org/jaxen/JaxenException	at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230)	at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)	at org.dom4j.tree.AbstractNode.selectNodes(AbstractNode.java:164)	at com.geoway.spatial.util.LocationUtils.parseTDTResponseDocument(LocationUtils.java:56)	at com.geoway.spatial.util.LocationUtils.queryTDTWFS(LocationUtils.java:33)	at com.geoway.spatial.service.impl.TDTLocationServiceImpl.getLocationByName(TDTLocationServiceImpl.java:28)	at com.geoway.spatial.service.impl.LocationAdapter.getLocationByName(LocationAdapter.java:31)	at com.geoway.spatial.service.impl.LocationAdapter.test(LocationAdapter.java:48)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:597)	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:297)	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:250)	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:144)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1329)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)	at java.security.AccessController.doPrivileged(Native Method)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217)	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987)	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909)	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)	at org.apache.catalina.core.StandardService.start(StandardService.java:516)	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)	at org.apache.catalina.startup.Catalina.start(Catalina.java:583)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:597)	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Caused by: java.lang.ClassNotFoundException: org.jaxen.JaxenException	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)	... 56 more

 根据异常,发现少了一个类:org.jaxen.JaxenException  这个类存在jaxen.jar包中,原因可想而知了!在路径下加入这个jar包即可。

转载地址:http://jqhfa.baihongyu.com/

你可能感兴趣的文章
Laravel 5.0 - Middleware (中间件)
查看>>
文件特殊权限及facl
查看>>
我的友情链接
查看>>
Android按两次返回键退出应用
查看>>
第一章:认识Redhat Linux
查看>>
文本查看指令
查看>>
我的友情链接
查看>>
android开源项目框架大全:《IT蓝豹》
查看>>
最小二乘法拟合圆公式推导及vc实现[r]
查看>>
使用Windows API获取和改变当前显示设置
查看>>
(原創) 用OOP实作矩阵相乘 (C/C++)
查看>>
Mozilla FireFox 2.0 简体中文版发布
查看>>
2006年最变态语录
查看>>
WM5/6常见进程列表
查看>>
信息系统开发平台OpenExpressApp - 支持日志功能
查看>>
什么是PIC单片机
查看>>
淘宝Web服务器Tengine正式开源
查看>>
Windows Azure Cloud Service (24) 在模拟器中运行时跳过Windows Azure Startup任务
查看>>
解决asp.net中使用FckEditor上传文件,中文名称乱码的问题
查看>>
POJ 3304 Segments
查看>>