trying to connecting jaserper server using jersy api throw exception?(尝试使用 jersy api 连接 jaserper 服务器引发异常?)
问题描述
当我尝试使用 jersy api 连接 jaserper 服务器时抛出异常 java.lang.NoSuchMethodError: org.glassfish.hk2.utilities.AbstractActiveDescriptor
When i am trying to connecting jaserper server using jersy api throw exception java.lang.NoSuchMethodError: org.glassfish.hk2.utilities.AbstractActiveDescriptor
代码如下
RestClientConfiguration configuration = new RestClientConfiguration("//localhost:80/jasperserver");
JasperserverRestClient client = new JasperserverRestClient(configuration);
//Session session = client.authenticate("jasperadmin", "jasperadmin");
OperationResult<InputStream> result = client
.authenticate("jasperadmin", "jasperadmin")
.reportingService()
.report("/reports/samples/Cascading_multi_select_report")
.prepareForRun(ReportOutputFormat.HTML, 1)
//.parameter("Cascading_name_single_select", "A & U Stalker Telecommunications, Inc")
.run();
InputStream report = result.getEntity();
我得到的确切异常如下
线程主"java.lang.NoSuchMethodError 中的异常:org.glassfish.hk2.utilities.AbstractActiveDescriptor.(Ljava/util/Set;Ljava/lang/Class;Ljava/lang/String;Ljava/util/Set;Lorg/glassfish/hk2/api/DescriptorType;Lorg/glassfish/hk2/api/DescriptorVisibility;ILjava/lang/Boolean;Ljava/util/Map;)V在org.jvnet.hk2.internal.ConstantActiveDescriptor.(ConstantActiveDescriptor.java:111) 在org.jvnet.hk2.internal.ConstantActiveDescriptor.(ConstantActiveDescriptor.java:111)在org.jvnet.hk2.internal.Utilities.getLocatorDescriptor(Utilities.java:795)在org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.initialize(ServiceLocatorGeneratorImpl.java:69)在org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.create(ServiceLocatorGeneratorImpl.java:91)在org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:230)在org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:207)在org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:121)在org.glassfish.jersey.internal.RuntimeDelegateImpl.(RuntimeDelegateImpl.java:60)在 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native方法)在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)在 java.lang.reflect.Constructor.newInstance(Constructor.java:408)在 java.lang.Class.newInstance(Class.java:433) 在javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:117) 在javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:207) 在javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135)在javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)在 javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95) 在javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) 在org.glassfish.jersey.client.JerseyWebTarget.(JerseyWebTarget.java:72)在org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:140)在org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:62)在com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage.init(SessionStorage.java:96)在com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage.(SessionStorage.java:56)在com.jaspersoft.jasperserver.jaxrs.client.core.JasperserverRestClient.authenticate(JasperserverRestClient.java:47)
Exception in thread "main" java.lang.NoSuchMethodError: org.glassfish.hk2.utilities.AbstractActiveDescriptor.(Ljava/util/Set;Ljava/lang/Class;Ljava/lang/String;Ljava/util/Set;Lorg/glassfish/hk2/api/DescriptorType;Lorg/glassfish/hk2/api/DescriptorVisibility;ILjava/lang/Boolean;Ljava/util/Map;)V at org.jvnet.hk2.internal.ConstantActiveDescriptor.(ConstantActiveDescriptor.java:111) at org.jvnet.hk2.internal.ConstantActiveDescriptor.(ConstantActiveDescriptor.java:111) at org.jvnet.hk2.internal.Utilities.getLocatorDescriptor(Utilities.java:795) at org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.initialize(ServiceLocatorGeneratorImpl.java:69) at org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl.create(ServiceLocatorGeneratorImpl.java:91) at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:230) at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:207) at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:121) at org.glassfish.jersey.internal.RuntimeDelegateImpl.(RuntimeDelegateImpl.java:60) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at java.lang.Class.newInstance(Class.java:433) at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:117) at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:207) at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135) at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120) at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95) at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) at org.glassfish.jersey.client.JerseyWebTarget.(JerseyWebTarget.java:72) at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:140) at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:62) at com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage.init(SessionStorage.java:96) at com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage.(SessionStorage.java:56) at com.jaspersoft.jasperserver.jaxrs.client.core.JasperserverRestClient.authenticate(JasperserverRestClient.java:47)
推荐答案
你也可以不使用任何api来做这个操作.只需使用 REST 调用所需的参数调用报表即可.这个指南会帮助你.
You can also do this operation without using any api. Just call the report with the parameters you want with REST call to your jasper server. This guide will help you.
这篇关于尝试使用 jersy api 连接 jaserper 服务器引发异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:尝试使用 jersy api 连接 jaserper 服务器引发异常?
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01