草庐IT

unknown-type

全部标签

java.lang.IllegalArgumentException : Unknown parameter name : customer 异常

我正在尝试使用getNamedQuery方法创建一个列表,但我遇到了这个异常。这是我的代码publicListgetEquipsByCustomer(intcustomer){return(List)sessionFactory.getCurrentSession().getNamedQuery("getEquipsByCustomer").setParameter("customer",customer).list();}以及xml文件中的查询SELECTe.*FROMrequestrINNERJOINequipeONr.equip_id=e.equip_idINNERJOINcus

java - Eclipse 3.5.1 编译器错误 :The type OutputFormat is not accessible due to restriction on required library . ./rt.jar

这个错误很奇怪,我无法理解它。我已经安装了EclipseRCP3.5.1,JavaSE1.6更新16并切换到SWT3.5。我创建了一个新项目,设置了依赖项并尝试编译。尝试导入时,请使用以下内容:importcom.sun.org.apache.xml.internal.serialize.OutputFormat;importcom.sun.org.apache.xml.internal.serialize.XMLSerializer;我得到错误:Accessrestriction:ThetypeXMLSerializerisnotaccessibleduetorestrictiono

java - 我可以将 Eclipse 设置为忽略 "Unhandled exception type"

是否可以让Eclipse忽略错误“未处理的异常类型”?在我的具体情况下,原因是我已经检查过文件是否存在。因此,我认为没有理由放入trycatch语句。file=newFile(filePath);if(file.exists()){FileInputStreamfileStream=openFileInput(filePath);if(fileStream!=null){还是我遗漏了什么? 最佳答案 IsitpossibletogetEclipsetoignoretheerror"UnhandledexceptiontypeFile

java - 警告 : Unknown version string [3. 1]。将使用默认版本

每当我在eclipse中运行webaps时,我总是收到这个警告:WARNING:Unknownversionstring[3.1].Defaultversionwillbeused.这是什么?我该怎么办? 最佳答案 或者您可以简单地使用不支持Servlet3.1的Web服务器。比如Tomcat7只支持Servlet3.0及以下版本。而Tomcat8支持servlet3.1。 关于java-警告:Unknownversionstring[3.1]。将使用默认版本,我们在StackOverf

java - Spring MVC 3.0 : Is String the preferred type to be used for @PathVariable?

请原谅我在这里问这么简单的问题,因为我是SpringMVC3.0的新手。我一直在阅读spring源网站上的文档几次。这是我将在下面的问题中引用的代码片段:-@RequestMapping("/pets/{petId}")publicvoidfindPet(@PathVariableStringpetId,Modelmodel){//implementationomitted}如果我打算使用基于此示例的URI模板,将@PathVariable类型设置为String是否总是更可取,即使我希望它是其他类型,例如int?文档说@PathVariable注释可以是任何简单类型,但是如果Sprin

java - 日期格式错误 java.sql.SQLException : Invalid column type

我使用pattern="dd-MMM-yyyy"在JSF中显示日期。当我尝试将日期值插入/更新到我的oracle数据库中时,我得到了java.sql.SQLException:Invalidcolumntype因为我插入或更新前的日期格式是这种格式WedFeb0900:00:00AST2011我如何才能正确地将我的日期值插入或更新到OracleDb以及执行此操作的最佳方法是什么?更新1我的数据库插入代码。privatevoideditSchedule(Scheduleschedule)Object[]values={schedule.getStartDate(),schedule.ge

java.lang.AssertionError : Content type not set while junit Spring MVC Controller? 错误

我正在使用JUnit来测试我的SpringMVCController。下面是我的方法,它返回一个index.jsp页面并在屏幕上显示HelloWorld-@RequestMapping(value="index",method=RequestMethod.GET)publicHashMaphandleRequest(){HashMapmodel=newHashMap();Stringname="HelloWorld";model.put("greeting",name);returnmodel;}下面是我对上述方法的JUnit测试:publicclassControllerTest{p

java - 使用 Hibernate 映射 FunctionalJava Option<Type>

我有一个hibernate映射的Java对象,JKL,其中充满了一堆正常的hibernate可映射字段(如字符串和整数)。我向它添加了一个新的嵌入字段(它位于同一个表中——而不是映射),asdf,这是一个fj.data.Option.我已将它作为一个选项来明确表示该字段实际上可能不包含任何内容(而不是每次访问它时都必须处理null)。如何在我的JKL.hbm.xml中设置映射文件?我希望hibernate自动转换null在数据库中为none的fj.data.Option当它检索对象时。它还应转换ASDF的非空实例到some的fj.data.Option.还有什么我必须做的其他诡计吗?

java - 碧 Jade 报告 : JRBeanCollectionDataSource cannot be resolved to a type

我在iReports中构建图表,当我在Eclipse中编译时出现以下错误:net.sf.jasperreports.engine.JRException:Errorswereencounteredwhencompilingreportexpressionsclassfile:1.net.sf.jasperreports.engine.JRBeanCollectionDataSourcecannotberesolvedtoatypevalue=newnet.sf.jasperreports.engine.JRBeanCollectionDataSource(((java.lang.Str

java - SSL 异常 : javax.net.ssl.SSLHandshakeException:收到致命警报:certificate_unknown

我已经创建了SSLClient和SSLServer,还为SSLServer创建了keystore"server.jks",为SSLClient创建了"client.jks"。首先我执行SSLServer.java文件,然后当我执行SSLClient.java文件时。它抛出异常"javax.net.ssl.SSLHandshakeException:Receivedfatalalert:certificate_unknown"。我不知道为什么我得到这个异常(exception)。我跟随http://ruchirawageesha.blogspot.in/2010/07/how-to-cr