- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
您好,我是编程新手,英语不是我的母语,所以我为错误表示歉意。
尝试向 API 发出 http 请求时出现以下异常
[ERROR ] SRVE0777E: Exception thrown by application class 'org.springframework.web.servlet.FrameworkServlet.processRequest:973'
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
at [internal classes]
Caused by: java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:60)
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:53)
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:95)
at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
at sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:100)
at java.lang.Class.getGenericInterfaces(Class.java:814)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.getAllContractsFromInterfaces(ReflectionHelper.java:366)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.getAdvertisedTypesFromClass(ReflectionHelper.java:351)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.getAdvertisedTypesFromObject(ReflectionHelper.java:391)
at org.glassfish.hk2.utilities.BuilderHelper.createConstantDescriptor(BuilderHelper.java:392)
at org.glassfish.hk2.utilities.binding.AbstractBindingBuilder$InstanceBasedBindingBuilder.complete(AbstractBindingBuilder.java:286)
at org.glassfish.hk2.utilities.binding.AbstractBinder.resetBuilder(AbstractBinder.java:179)
at org.glassfish.hk2.utilities.binding.AbstractBinder.complete(AbstractBinder.java:189)
at org.glassfish.hk2.utilities.binding.AbstractBinder.bind(AbstractBinder.java:173)
at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:406)
at org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:86)
at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:118)
at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:115)
at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:322)
at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:721)
at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:284)
at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:126)
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:98)
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:91)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:408)
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:308)
at br.com.MyLOL.home.LOLClient.getSummonerInfo(LOLClient.java:23)
at br.com.MyLOL.summoner.SummonerService.getSummonerInfo(SummonerService.java:16)
at br.com.MyLOL.home.HomeController.result(HomeController.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
... 6 more
[ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
at [internal classes]
这是maven pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MyLOL</groupId>
<artifactId>MyLOL</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<repositories>
</repositories>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.14</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.18.3</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
抛出异常的方法
public Summoner getSummonerInfo(Summoner summoner) {
javax.ws.rs.client.Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://" + summoner.getSummonerRegion()+".api.pvp.net");
String summonerInfo = target.path("api/lol/"+ summoner.getSummonerRegion() +"/v1.4/summoner/by-name/" + summoner.getSummonerName() + "?api_key=11111111111").request().get(String.class);
System.out.println(summonerInfo);
return new Summoner();
}
我知道还有什么与某人相关以帮助找到解决方案,所以请向我询问您可能需要的任何其他内容
最佳答案
据我所知,无论您尝试获取的字符串是什么,它都不是字符串。也许您正在使用的那个 API(我没有调查那个)试图以一种不可能的方式构造那个字符串。
关于java.lang.reflect.MalformedParameterizedTypeException 试图向 API 发出请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27508315/
我是 C++ 的新手,我在使用这段代码时遇到了问题: string output_date(int day, int month, int year){ string date; if
所以我这样做了 tar cvzf test.zip FP 为了创建目录 FP 的 zip 但是,它会列出 zip 中的目录 FP/ FP/php/ FP/php/pdf/ FP/php/docs/ F
我正在尝试在 Swift、Xcode 7.3(所以是 Swift 2.2)中创建一个通用类,但我似乎无法让它通过编译器: protocol Struct1Protocol { } struct Str
我的测试用例是这样的: class FooTest extends PHPUnit_Framework_TestCase { /** @covers MyClass::bar */ f
我正在尝试将brew install wine作为使electron-builder工作的一步。但是我所能得到的只是以下响应: ==> Installing dependencies for wine
我这样做: string[,] string1 = {{"one", "0"},{"Two", "5"},{"Three","1"}}; int b = 0; for(int i = 0; i <=
我正在尝试使用 SetWindowsHookEx 键盘 Hook Notepad.exe。 如您所见,工作线程正在将其 ASCII 代码(即 wParam)发送到指定的服务器。 UINT WINAPI
我正在尝试将 ListView 实现到我的 Fragment 中,但无论我尝试什么,我都会得到一个 NullPointerException。我检查对象是否为 null 并记录是否为 null,看起来
我尝试在一行中对齐两个 div。使用 float left 属性,一切顺利。但是当我在 div 中使用图像时,它开始产生问题。 所以这是我的示例代码:- Some headi
我目前正在使用此代码来获取图像的灰度图像表示并以 (512, 370, 1) 的格式表示它大批。 img_instance = cv2.imread(df.iloc[i][x_col]) / 255.
总结 我正在创建一个简单的应用程序,它允许用户选择一个包含顶级窗口的进程。用户首先键入 native DLL(而非托管 DLL)的路径。然后用户键入将在 Hook 过程中调用的方法的名称。该方法不得返
我是一名优秀的程序员,十分优秀!