写Java工程时使用import com.sun.jmx.snmp.Timestamp报错

图片说明
求问,在写Java工程,引用了import com.sun.jmx.snmp.Timestamp;
import com.sun.xml.internal.ws.message.StringHeader;配置过JDK,但是提示说这两个没有包含在JDK里是什么情况呀?怎么解决呀?

0

2个回答

建议错误要截图出来。

0
0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JAVA servlet import 报错
import java.io.IOException;rnrnimport java.io.PrintWriter;rnrnimport java.util.ArrayList;rnrnimport java.util.List;rnrnrnimport javax.servlet.ServletException;rnrnimport javax.servlet.http.HttpServlet;rnrnimport javax.servlet.http.HttpServletRequest;rnrnimport javax.servlet.http.HttpServletResponse;rnrnrnimport com.itcast.manager.BookManager;rnrnimport com.itcast.web.entity.Book;rnrnrnpublic class ServletBook extends HttpServlet rnrnrnpublic void doGet(HttpServletRequest request, HttpServletResponse response)rnrnthrows ServletException, IOException rnrndoPost(request, response);rnrnrnrnrnpublic void doPost(HttpServletRequest request, HttpServletResponse response)rnrnthrows ServletException, IOException rnrnString type = request.getParameter("type");rnrnif (type != null && type.trim().equalsIgnoreCase("findById")) rnrnrn else if (type != null && type.trim().equalsIgnoreCase("findAll")) rnrnrn else if (type != null && type.trim().equalsIgnoreCase("deleteById")) rnrnrn else if (type != null && type.trim().equalsIgnoreCase("deleteAll")) rnrnrn else rnrnList bs = new ArrayList();rnrnBookManager bm = BookManager.getInstance();rnrnbs = bm.findAll();rnrnrequest.getSession().setAttribute("bs", bs);rnrnresponse.sendRedirect("/day10/listBook.jsp");rnrnrnrnrnrnrnrnrn rnrn rnrn很简单的类 居然第8行 import报错rnrn rnrn rnrnAn error occurred at line: 8 in the generated java filernrnSyntax error on token "import", Identifier expected after this tokenrnrnrnStacktrace:] with root causernrn rnrn试过把所有注释掉 只写一个重定向也不行 求解..rn
打开工程时报错!
发现有的工程包含example.csproj.vspscc,有的工程包含example.csproj.webinfo,这两个文件用途一样吗?我在工程中发现只有example.csproj.vspscc这个文件,且打开工程example.csproj时提示:rnrnThe project you are trying to open is a Web project. You need to open it by specifying its URL path.rnrn帮助中提示修改csproj.webinfo这个文件,但没有这个文件。请指教!
Eclipse中import新的工程报错的解决方法
1. 右击项目工程名,Properties/Resource/Text file encoding 选择Other: UTF-8 2. 右击项目工程名,Properties/Android 查看此工程是否缺少android的jar包,如没有则可以选择相应的版本 3. 右击项目工程名,Properties/Java Build Path 查看此工程是否缺少相应的jar文件. 4. 查看工程的r
MyEclipse import自己写的类时报错,急,在线等
MyEclipse哪里出错了,为什么会这样?rnrn[img=https://img-bbs.csdn.net/upload/201408/21/1408607321_859381.jpg][/img]
java import关键字使用
java关键词importjava关键字import的使用细节 java关键字import的使用细节 显示导入指定包下的类或者接口 import java.util.Scanner; 写在包的声明和源文件之间 package com.demo.util; import java.util.Date; public class Demo{...} 如果需要引入多个类或者接口,那么就并列...
java 类的使用和import 的使用
在Java中不仅可以调用系统中的类,还可以自己创建类并且调用使用 首先,创建一个新的包package,在这个包中创建一个或多个class 文件的类 package new; class Person { int age; String name; public void say() { System.out.println(age+name)...
写数据库时报错
我用的是mysql数据库,delphi6在向数据库写入数据时,系统提示“Non-blob column in table required to perform operation”但是也能够正常写入,为什么?
关闭WebStrom在写vue的import使用双引号报错提示
在webstorm的设置里面找到以下图片的位置将enable勾选去掉即可
Android 工程签名打包时报错
记录一个编译打包时遇到的小错误 集成完支付宝之后签名打包时报了个错,上截图 弹框里说混淆代码时报错啦!看看控制台吧! 然后控制台上说没有找到你这个东西,查看了一下lib目录和build path都没有问题,工作空间也有这个jar包,那倒是是哪出错了呢? 仔细看了一下错误原因是混淆是出错,那就看一下混淆代码的文件吧 果然,jar包名称不一致,当时直接吧支付宝文档里的jar包名称...
tomcat发布工程时报错
严重: The web application [/struts205] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@4c9860]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@a7d316]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-12-29 15:00:45 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMaprn严重: The web application [/struts205] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@4c9860]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1a1ad7d]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-12-29 15:00:47 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
BCB运行工程时报错
自己写的一个工程,以前都能编译过的。现在突然不能编过了也不能修改了!专家包搜索匹配时也会报错。具体错误为“Access violation at address 00C90CAB in module 'COMP32P.DLL'.Read of address 00000000”,求大侠帮忙指教。
VC2003 #import msado15.dll,程序退出时老报错
只要在头文件里加了:rn#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename ("EOF", "adoEOF") rnrn其他什么代码都不写,程序关闭时会提示非法指针访问,为什么?
pymssql已安装,import时报错
pymssql已安装,使用pip list查看rn[align=left][img=https://img-bbs.csdn.net/upload/201802/13/1518487116_248356.png][/img][/align]rnrn使用pip --version 查看版本9.0.1rn[img=https://img-bbs.csdn.net/upload/201802/13/1518489465_19381.png][/img]rnrn查看python版本3.6.3rn[img=https://img-bbs.csdn.net/upload/201802/13/1518489311_215645.png][/img]rnrn但是在import pymssql的时候报错,重启也不行rn[img=https://img-bbs.csdn.net/upload/201802/13/1518489441_722798.png][/img]
spring 写junit测试时使用aop报错
n当我在我的配置文件中加上如下配置会包下面的错误,我不加时就不会出错这是为什么n```n n nn nn n n n n```nnn```n org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AdvertServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.qtt.service.impl.UserServiceImpl AdvertServiceTest.userService; nested exception is java.lang.IllegalArgumentException: Can not set cn.qtt.service.impl.UserServiceImpl field AdvertServiceTest.userService to com.sun.proxy.$Proxy17n at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:374) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110) ~[org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) ~[org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321) ~[org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [junit.jar:na]n at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [junit.jar:na]n at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [junit.jar:na]n at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [junit.jar:na]n at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [junit.jar:na]n at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [junit.jar:na]n at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [junit.jar:na]n at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [junit.jar:na]n at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) [org.springframework.test-3.1.1.RELEASE.jar:3.1.1.RELEASE]n at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) [.cp/:na]n at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]n at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) [.cp/:na]n at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) [.cp/:na]n at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) [.cp/:na]n at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [.cp/:na]nCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.qtt.service.impl.UserServiceImpl AdvertServiceTest.userService; nested exception is java.lang.IllegalArgumentException: Can not set cn.qtt.service.impl.UserServiceImpl field AdvertServiceTest.userService to com.sun.proxy.$Proxy17n at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n ... 26 common frames omittednCaused by: java.lang.IllegalArgumentException: Can not set cn.qtt.service.impl.UserServiceImpl field AdvertServiceTest.userService to com.sun.proxy.$Proxy17n at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[na:1.7.0_51]n at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[na:1.7.0_51]n at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) ~[na:1.7.0_51]n at java.lang.reflect.Field.set(Unknown Source) ~[na:1.7.0_51]n at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502) ~[spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]n ... 28 common frames omittedn```nnn
运行npm-run-dev时报错,应该是import和export
如何。看的教学视频,视频里的老师这样写就没事,我一写就报错。在app.vue中引入components/header/header.vue这个组件。系统报错,怎么都搞不好。。。。
急救!在使用ibatis+struts2写模糊查询时,报错
配置文件:[code=java]rn select * from goods where goodName like concat('%',#goodName#,'%')rn [/code]rn异常:[code=java]com.ibatis.common.jdbc.exception.NestedSQLException: rn--- The error occurred in com/dcst/imicai/bean/goods.xml. rn--- The error occurred while applying a parameter map. rn--- Check the getGoodsByKeyword-InlineParameterMap. rn--- Check the statement (query failed). rn--- Cause: java.sql.SQLException: Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like'[/code]
Eclipse中Pydev使用import时出现报错
问题描述:刚刚尝试使用python,python2.7+numpy,在eclipse上安装了Pydev,然后执行下面程序时报错:undefined variable from import import numpy as np print np.random.rand(4,4)解决方法把python安装文件夹下的Lib中大写的L改成小写的,即lib就可以了
htm下的script使用import引入js报错
将 script标签的type改成 <script type="module"> <script type="module"> import './yourJSModule' </script >  
使用Android studio,import‘R’报错
![图片说明](https://img-ask.csdn.net/upload/201703/23/1490255052_927734.png)
import requests 报错
rn通过pip install requests已经安装了requests,也用了一段时间正常的,但是突然就不好使了,求助哇~rnrn日志如下:rnrnTraceback (most recent call last):rn[b] [color=#FF0000]File "E:\Python\workspace\PyStudy\src\test1\test.py", line 1, in rn import requestsrn File "C:\Python27\lib\site-packages\requests\__init__.py", line 63, in rn from . import utilsrn File "C:\Python27\lib\site-packages\requests\utils.py", line 23, in rn from .compat import parse_http_list as _parse_list_headerrn File "C:\Python27\lib\site-packages\requests\compat.py", line 33, in rn import jsonrn File "C:\Python27\lib\json\__init__.py", line 99rn """rn ^rnSyntaxError: invalid syntaxrn[/color][/b]
为什么"import javax.servlet.*"报错?
是不是j2sdk1.4.2_04不支持了?rnrn怎么解决?
安装tensorflow,import报错。
刚准备学习tensorflow,发现昨天刚发布了2.0大版本更新,好开心。 > pip install tensorflow Successfully installed absl-py-0.7.0 astor-0.7.1 gast-0.2.2 grpcio-1.19.0 h5py-2.9.0 keras-applications-1.0.7 keras-preprocessing-1.0...
import Tkinter的时候报错
在看到图形界面编程的时候,需要导入Tkinter模块,从而在解释器中进行import Tkinter,然后。。。报错如下:   >>> from tkinter import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/loca...
import javax.script.*;在报错????
具体类rnrnpackage other;rnrnimport javax.script.*;rnimport java.io.*;rnrn// Evaluate a file of JavaScript and print its resultrnpublic class RunScript rn public static void main(String[] args) throws IOException rn // Obtain an interpreter or "ScriptEngine" to run the script.rn ScriptEngineManager scriptManager = new ScriptEngineManager( );rn ScriptEngine js = scriptManager.getEngineByExtension("js");rnrn // The script file we are going to runrn String filename = null;rnrn // A Bindings object is a symbol table for or namespace for thern // script engine. It associates names and values and makesrn // them available to the script.rn Bindings bindings = js.createBindings( );rnrn // Process the arguments. They may include any number ofrn // -Dname=value arguments, which define variables for the script.rn // Any argument that does not begin with -D is taken as a filenamern for(int i = 0; i < args.length; i++) rn String arg = args[i];rn if (arg.startsWith("-D")) rn int pos = arg.indexOf('=');rn if (pos == -1) usage( );rn String name = arg.substring(2, pos);rn String value = arg.substring(pos+1);rn // Note that all the variables we define are strings.rn // Scripts can convert them to other types if necessary.rn // We could also pass a java.lang.Number, a java.lang.Booleanrn // or any Java object or null.rn bindings.put(name, value);rn rn else rn if (filename != null) usage( ); // only one file pleasern filename = arg;rn rn rn // Make sure we got a file out of the arguments.rn if (filename == null) usage( );rnrn // Add one more binding using a special reserved variable namern // to tell the script engine the name of the file it will be executing.rn // This allows it to provide better error messages.rn bindings.put(ScriptEngine.FILENAME, filename);rnrn // Get a stream to read the script.rn Reader in = new FileReader(filename);rnrn try rn // Evaluate the script using the bindings and get its result.rn Object result = js.eval(in, bindings);rn // Display the result.rn System.out.println(result);rn rn catch(ScriptException ex) rn // Or display an error message.rn System.out.println(ex);rn rn rnrn static void usage( ) rn System.err.println(rn "Usage: java RunScript [-Dname=value...] script.js");rn System.exit(1);rn rnrnrnrn报错:rnrnException in thread "main" java.lang.Error: Unresolved compilation problems: rn ScriptEngineManager cannot be resolved to a typern ScriptEngineManager cannot be resolved to a typern ScriptEngine cannot be resolved to a typern Bindings cannot be resolved to a typern ScriptEngine cannot be resolvedrn ScriptException cannot be resolved to a typern ex cannot be resolvedrnrn at other.RunScript.main(RunScript.java:10)rnrnrn
为何import会报错?
看别人的代码,直接打开jpx文件编译,可是所有引用包内的类的import语句都报错,说这个包不存在,可是这些包的java文件全在src目录下,按包的名字存放着呀rn谁能告诉我这是怎么回事?rn我是新手,别笑我呀
import javax.swing.JOptionPane;报错
[img=https://img-bbs.csdn.net/upload/201407/11/1405065338_504806.png][/img]rnrnAccess restriction: The type JOptionPane is not accessible due to restriction on required library D:\Java\jre8\librn \rt.jarrnrn请问这是什么意思?为什么会报错?
import c报错解决办法
import scipy.misc报错,ImportError: DLL load failed: 找不到指定的模块。
import pylibconfig2 报错的解决方案
C:\Windows\system32>python Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pylibconf
为什么 "import com.borland.jbcl.layout.*;" 报错?
代码:rnimport com.borland.jbcl.layout.*;rnrn结果:rnE:\Program\test\abc.java:3: package com.borland.jbcl.layout does not existrnimport com.borland.jbcl.layout.*;rn^rn1 error
pycharm中import报错 命令行import正常
一、问题起源:在pycharm中的import会找不到,在命令行中import可以找到二、原因:可能是自己电脑中安装了多个python环境。比如我的电脑中的cassandra安装在了位置A,而pycharm在位置B,因此会找不到三、解决办法:将pycharm中的A改为B...
JAVA Castor 使用GeneralizedFieldHandler 在unmarshall时报错
我在使用GeneralizedFieldHandler自定义Field的handler时,marshall成功,unmarshall却报错,不求甚解啊。rn下面是代码以及输出结果,希望高手能帮忙解答,不甚感激。rn代码由JAVABEAN : Root.java , GeneralizedFieldHandler : DivDateHandler ,rnMapping File : Root.cst.xml 以及 Test File : DivCastorTestrn结尾为DivCastorTest输出结果rn[code="java"]rn * Root.javarnpackage com.siyuan.castor;rnrnimport java.util.Date;rnrn/**rn * This classrn * rn * @author Carro.Zhurn * @version $Revision$, $Date$, $Author$, $Name$rn */rnpublic class Root rnrn private Date date;rnrn public Root() rnrn rnrn /**rn * @return the datern */rn public Date getDate() rn return date;rn rnrn /**rn * @param datern * the date to setrn */rn public void setDate(Date date) rn this.date = date;rn rnrn @Overridern public String toString() rn return "ROOT[Date = " + date + "]";rn rnrnrn[/code]rn[code="java"]rn * DivDateHandler.javarnpackage com.siyuan.castor.handler;rnrnimport java.text.DateFormat;rnimport java.text.ParseException;rnimport java.text.SimpleDateFormat;rnimport java.util.Date;rnrnimport org.exolab.castor.mapping.GeneralizedFieldHandler;rnrn/**rn * This classrn * rn * @author Carro.Zhurn * @version $Revision$, $Date$, $Author$, $Name$rn */rnpublic class DivDateHandler extends GeneralizedFieldHandler rnrn private static final String LOCAL_DATE_FORMAT = "yyyy-MM-dd";rnrn @Overridern public Object convertUponGet(Object value) rn if (value == null)rn return null;rn DateFormat dateFmt = new SimpleDateFormat(LOCAL_DATE_FORMAT);rn return dateFmt.format((Date) value);rn rnrn @Overridern public Object convertUponSet(Object value) rn if (value == null)rn return null;rn DateFormat dateFmt = new SimpleDateFormat(LOCAL_DATE_FORMAT);rn Date date = null;rn try rn date = dateFmt.parse((String) value);rn catch (ParseException e) rn throw new IllegalArgumentException(e);rn rn return date;rn rnrn @Overridern public Class getFieldType() rn return Date.class;rn rnrnrn[/code]rn[code="xml"]rnrnrn rn rn rn rn rnrn[/code]rn[code="java"]rn * DivCastorTest.javarnpackage com.siyuan.castor.test;rnrnimport java.io.IOException;rnimport java.io.InputStream;rnimport java.io.StringReader;rnimport java.io.StringWriter;rnimport java.util.Date;rnrnimport org.exolab.castor.mapping.Mapping;rnimport org.exolab.castor.mapping.MappingException;rnimport org.exolab.castor.xml.MarshalException;rnimport org.exolab.castor.xml.Marshaller;rnimport org.exolab.castor.xml.Unmarshaller;rnimport org.exolab.castor.xml.ValidationException;rnimport org.xml.sax.InputSource;rnrnimport com.siyuan.castor.Root;rnrn/**rn * This classrn * rn * @author Carro.Zhurn * @version $Revision$, $Date$, $Author$, $Name$rn */rnpublic class DivCastorTest rnrn /**rn * @param argsrn */rn public static void main(String[] args) rn Root root = new Root();rn root.setDate(new Date());rnrn Mapping mapping = new Mapping();rn InputStream mappingFileIn = DivCastorTest.classrn .getResourceAsStream("/com/siyuan/castor/Root.cst.xml");rn mapping.loadMapping(new InputSource(mappingFileIn));rnrn Marshaller marshaller = new Marshaller();rn StringWriter result = new StringWriter();rn Unmarshaller unmarshaller = new Unmarshaller();rn try rn marshaller.setMapping(mapping);rn marshaller.setWriter(result);rn marshaller.marshal(root);rn System.out.println(result);rnrn unmarshaller.setMapping(mapping);rn Root rootParsed = (Root) unmarshaller.unmarshal(new StringReader(rn result.toString()));rn System.out.println(rootParsed);rn catch (MappingException e) rn e.printStackTrace();rn catch (MarshalException e) rn e.printStackTrace();rn catch (ValidationException e) rn e.printStackTrace();rn catch (IOException e) rn e.printStackTrace();rn rnrn rnrnrn[/code]rn输出结果:rn[code="java"]rnrnrnorg.exolab.castor.xml.MarshalException: Bad DateTime format: 2011-08-02rnDateTime is not long enoughFile: ; line: 2; column: 26rn at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:755)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:721)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)rn at com.siyuan.castor.test.DivCastorTest.main(DivCastorTest.java:55)rnCaused by: java.lang.IllegalStateException: Bad DateTime format: 2011-08-02rnDateTime is not long enoughrn at org.exolab.castor.xml.handlers.DateFieldHandler.setValue(DateFieldHandler.java:173)rn at org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHandler.java:3026)rn at org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandler.java:2676)rn at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1638)rn at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1353)rn at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)rn at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)rn at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)rn at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)rn at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)rn at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)rn ... 2 morernCaused by: java.lang.IllegalStateException: Bad DateTime format: 2011-08-02rnDateTime is not long enoughrn at org.exolab.castor.xml.handlers.DateFieldHandler.setValue(DateFieldHandler.java:173)rn at org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHandler.java:3026)rn at org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandler.java:2676)rn at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1638)rn at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1353)rn at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)rn at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)rn at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)rn at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)rn at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)rn at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)rn at com.siyuan.castor.test.DivCastorTest.main(DivCastorTest.java:55)rnCaused by: java.lang.IllegalStateException: Bad DateTime format: 2011-08-02rnDateTime is not long enoughrn at org.exolab.castor.xml.handlers.DateFieldHandler.setValue(DateFieldHandler.java:173)rn at org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHandler.java:3026)rn at org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandler.java:2676)rn at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1638)rn at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1353)rn at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)rn at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)rn at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)rn at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)rn at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)rn at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)rn at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)rn at com.siyuan.castor.test.DivCastorTest.main(DivCastorTest.java:55)rn[/code]
使用oscache时报错
Exception persisting /adminmanage/eWebEditor/upload.jsp_POST_YWN0aW9uPXJlbW90ZSZlV2ViRWRpdG9yX1VwbG9hZFRleHQ9Pz8/PyZzdHlsZT1zdGFuZGFyZCZ0rneXBlPXJlbW90ZQ==rncom.opensymphony.oscache.base.persistence.CachePersistenceException: Unable to write 'D:\Tomcat 5.0\myweb\cache\application\_0adminmanage_12eWebEditor_23upload_30jsp_34POST_39YWN0aW9uPXJlbW90ZSZlV2ViRWRpdG9yX1VwbG9hZFRleHQ9Pz8_91PyZzdHlsZT1zdGFuZGFyZCZ0rneXBlPXJlbW90ZQ==.cache' in the cache. Exception: java.io.FileNotFoundException, Message: D:\Tomcat 5.0\myweb\cache\application\_0adminmanage_12eWebEditor_23upload_30jsp_34POST_39YWN0aW9uPXJlbW90ZSZlV2ViRWRpdG9yX1VwbG9hZFRleHQ9Pz8_91PyZzdHlsZT1zdGFuZGFyZCZ0rneXBlPXJlbW90ZQ==.cache (ÎļþÃû¡¢Ä¿Â¼Ãû»ò¾í±êÓï·¨²»ÕýÈ·¡£)rn at com.opensymphony.oscache.plugins.diskpersistence.AbstractDiskPersistenceListener.store(AbstractDiskPersistenceListener.java:358)rn at com.opensymphony.oscache.plugins.diskpersistence.AbstractDiskPersistenceListener.store(AbstractDiskPersistenceListener.java:238)rn at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.persistStore(AbstractConcurrentReadCache.java:1101)rn at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.put(AbstractConcurrentReadCache.java:1580)rn at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.put(AbstractConcurrentReadCache.java:863)rn at com.opensymphony.oscache.base.Cache.putInCache(Cache.java:571)rn at com.opensymphony.oscache.base.Cache.putInCache(Cache.java:524)rn at com.opensymphony.oscache.web.filter.CacheFilter.doFilter(CacheFilter.java:115)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)rn at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Thread.java:534)rn
使用struts时报错
报错信息:javax.servlet.ServletException: Request[/common/count] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text.rnrnrna.jsp-->b.jsp-->actionrn各页面主要代码如下:rna.jsp:rn rnrnrnb.jsp(在js的check()函数内提交form到action):rnrnrnrnconfig.xml:rn rn rn rn rnrn麻烦大家帮忙看看是什么原因?
使用Ghost时报错。
在XP下使用Ghost报错:A source volume could not be locked!(640)rnrn不知何故,请各位大侠指教。
在使用HSQLDB时报错
rn错误信息:rnCaused by: org.hsqldb.HsqlException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@4facc966[file =C:\Users\user\Documents\hsqldb\data\database.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2011-11-12 04:04:19 heartbeat - read: -1941 ms.rn at org.hsqldb.error.Error.error(Error.java:77)rn at org.hsqldb.persist.LockFile.newLockFileLock(LockFile.java:642)rn at org.hsqldb.persist.Logger.acquireLock(Logger.java:1076)rn at org.hsqldb.persist.Logger.openPersistence(Logger.java:284)rn at org.hsqldb.Database.reopen(Database.java:220)rn at org.hsqldb.Database.open(Database.java:186)rn at org.hsqldb.DatabaseManager.getDatabase(DatabaseManager.java:240)rn at org.hsqldb.DatabaseManager.newSession(DatabaseManager.java:157)rn at org.hsqldb.jdbc.JDBCConnection.(JDBCConnection.java:3281)rnrnrn开始操作是没有问题的,可等吃玩饭回来后,再次创建表就报这个错,有没有哪位同志也遇到过,求解。
使用unordered_map时报错
在unordered_map&amp;lt;string,int&amp;gt;使用时,报错,提示string的==找不到 原来是string的头文件,应该用string而不是string.h
使用Session时报错
使用Session时rnif (session["uid"].tostring()==null)rnrn...rnrn报错:rnSystem.NullReferenceException: 未将对象引用设置到对象的实例。rnrn这是2.aspx文件,我在1.aspx中对Session进行了赋值,然后调用2.aspx就没有报错,但直接在地址栏中输入2.aspx知道到这句时出现上面错误信息,我本来想让它弹出登录画面的。如何解决,谢谢!
使用yum时报错
[root@iZ2535el0z8Z /]# yum rpmdb: unable to join the environment error: db3 error(11) from dbenv->open: Resource temporarily unavailable error: cannot open Packages index using db3 - Resource temporar
使用dblink时报错
使用dblink进行跨库操作时,报错不知道原因,请教一下。由于原本机器不能联网,我举例描述一下我遇到的问题。rn机器A:IP:192.168.0.1,psql9.4rn机器B:IP:192.168.0.2,psql9.5rnrn在两个机器分别建表rncreate table test_t1(id integer,name text);rn在两个机器安装扩展包dblinkrn在机器b的psql执行:rnselect dblink_connect('con','hostaddr=192.168.0.1 port=5432 user=postgres passwd=123456 dbname=postgres');rn这一步没问题。rnrn执行rnselect dblink_exec('con','insert into test_t1(1,'234')');rn没有问题,显示插入一行。rnrn执行rnselect dblink_exec('con','insert into test_t1(1,'abc')');rn就会报错,显示在abc附近语法错误。
使用jatoolsPrinter 时报错
提示不存在可打印的页
相关热词 c#异步发送kafka c#窗体编号 c# 操作二进制文件 c# 反射 机制 c#线程 窗体失去响应 c#角度转弧度 c# 解析gps数据 c# vs设置 语法版本 c# json含回车 c#多线程demo