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 服务器引发异常?
基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 降序排序:Java Map 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01