草庐IT

illegalArgumentException

全部标签

java - 尝试为实体创建 key 时出现 IllegalArgumentException

我正在使用GoogleAppEngine,但遇到了困难。我正在尝试为我的实体创建一个key。这是代码:Elementchild=(Element)itr.next();Stringname="";if(child.getQualifiedName().equals("name")){name+=child.getText();}KeydrugKey=KeyFactory.createKey("DrugTarget",name);我100%确定child.getText()不会返回null。我已经测试过了。我有另一段代码可以完美地创建Key。两者看起来彼此相似。Stringdrug=re

java - cglib 在增强 java.util.Date 类时抛出 IllegalArgumentException

我正在尝试使用cglib增强java.util.Date。它不起作用,而且我没有使用cglib的经验,所以我想知道出了什么问题。例如,下面增强ArrayList的代码有效:@Testpublicvoidenhance_ArrayList(){Enhancerenhancer=newEnhancer();enhancer.setSuperclass(ArrayList.class);enhancer.setCallback(newFixedValue(){@OverridepublicObjectloadObject()throwsException{return"Hellocglib!

java - 使用 java.nio.file.Paths 接口(interface)时缺少方案 (IllegalArgumentException)

这是一个非常简单的Java问题。我在linux系统上使用Java8和eclipsekepler。我一直在尝试NIO.2。我的代码是:packagelucasTest;importjava.io.IOException;importjava.net.URI;importjava.net.URISyntaxException;importjava.nio.file.*;publicclassLucas{publicstaticvoidmain(String[]args)throwsURISyntaxException{URIu=newURI("./Lucas.java");Pathp=Pa

java.lang.IllegalArgumentException : No SchemaFactory that implements the schema language specified 异常

我收到以下异常:java.lang.IllegalArgumentException:NoSchemaFactorythatimplementstheschemalanguagespecifiedby:http://www.w3.org/2001/XMLSchema-instancecouldbeloadedatjavax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:204)atMAIN.SchemaImport3.validateXMLSchema(SchemaImport3.java:74)atMAIN.S

java.lang.IllegalArgumentException : FormUrlEncoded can only be specified on HTTP methods with request body (e. g., @POST)

我正在尝试通过API上的GET方法从数据库中获取数据这是我的代码APIServive.InterfacepublicinterfaceAPIService{@FormUrlEncoded@GET("Event")CallviewEvent();}EventModel.JavapublicclassEventModel{@SerializedName("nama_event")Stringnama_event;@SerializedName("jenis_event")Stringjenis_event;@SerializedName("creator")Stringcreator;@S

java - 先决条件库为 notNull 检查抛出 IllegalArgumentException

你知道ApacheCommonsValidate的一些不错的替代品吗?或GuavaPreconditions在检查对象是否为notnull(SpringAssert除外)时会抛出IllegalArgumentException而不是NullPointerException?我知道Javadocs说:Applicationsshouldthrowinstancesofthisclass[NullPointerException]toindicateotherillegalusesofthenullobject.不过,我就是不喜欢它。对我来说,NPE总是意味着我只是忘了在某处保护空引用。我

java - 为什么我在创建 map 时会收到 IllegalArgumentException?

我正在尝试创建城市和温度的map,但它抛出了IllegalArgumentException。这是我正在做的:MaptempMap=Map.of("London",13,"Paris",17,"Amsterdam",13,"Madrid",21,"Rome",19,"London",13,"Bonn",14,"Moscow",7,"Barcelona",20,"Berlin",15);如果我将它们一一添加就没有问题:MaptempMap=newHashmap();//orLinkedHashMaptempMap.put("London",13);tempMap.put("Madrid"

java - 初始化 Spring 上下文时 org.springframework.asm.ClassReader 出现 IllegalArgumentException

任何人都可以指导我在尝试执行javaspring程序时遇到下面提到的错误的可能原因。错误如下...Aug20,20144:43:54PMorg.apache.catalina.core.AprLifecycleListenerinitINFO:TheAPRbasedApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:C:\ProgramFiles(x86)\Java\jre8\bin;C:\Windows\Sun\J

java - 我应该如何解决 java.lang.IllegalArgumentException : protocol = https host = null Exception?

我正在开发一个SSL客户端服务器程序,我必须重用以下方法。privatebooleanpostMessage(Stringmessage){try{StringserverURLS=getRecipientURL(message);serverURLS="https:\\\\abc.my.domain.com:55555\\update";if(serverURLS!=null){serverURL=newURL(serverURLS);}HttpsURLConnectionconn=(HttpsURLConnection)serverURL.openConnection();conn

java - illegalargumentexception - 项目在 Netbeans 上运行但不作为 War 文件在 Tomcat 上运行

我在本地机器上使用JDK1.7(32位)在Netbeans上创建了一个项目在运行应用程序时(在netbeans上使用tomcat8.0服务器),它在http://localhost:8080/WebApplication1上完美运行。.我直接从dist复制了war文件并将其传输到我安装了tomcat8.0和jdk1.8(64位)的WindowsVM服务器。然后通过tomcat的managerwebapp上传war文件。注意:“localhost:8080/”和“localhost:8080/manager”运行没有任何问题。但是,当我运行应用程序时(http://localhost:8