Jump to content
We've recently updated our Privacy Statement, available here ×

pedro.felgueiras

Members
  • Posts

    2
  • Joined

  • Last visited

pedro.felgueiras's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I'm making a Java Bean to get the data derectly from an web service.For that i have made a Maven project that are running as it suposed. It have a similar structure that a project that i have previusly made to test the Java Bean Data Source. It have a factor and an entity. The dependecies that the project have are the spring-web 4.1.5.RELEASE , commons-codec 1.10 and the gson 2.3.1. When testing the Data Source from the Java Bean it gives me this error: net.sf.jasperreports.engine.JRException: java.lang.reflect.InvocationTargetException at net.sf.jasperreports.data.bean.BeanDataAdapterService.contributeParameters(BeanDataAdapterService.java:108) at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:128) at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.run(AbstractDataAdapterWizard.java:157) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.sf.jasperreports.data.bean.BeanDataAdapterService.contributeParameters(BeanDataAdapterService.java:83) ... 3 moreCaused by: java.lang.NoSuchMethodError: org.springframework.util.CollectionUtils.unmodifiableMultiValueMap(Lorg/springframework/util/MultiValueMap;)Lorg/springframework/util/MultiValueMap; at org.springframework.web.util.HierarchicalUriComponents.(HierarchicalUriComponents.java:84) at org.springframework.web.util.UriComponentsBuilder.build(UriComponentsBuilder.java:340) at org.springframework.web.util.UriComponentsBuilder.build(UriComponentsBuilder.java:324) at org.springframework.web.util.UriTemplate.(UriTemplate.java:69) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:528) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475) at pt.i2s.it2s.bean.first_report.factory.ReportFactory.load(ReportFactory.java:40) ... 8 more[/code] The code is : protected static ClientHttpRequestFactory clientHttpRequestFactory; protected static RestTemplate restTemplate; public static List load(){ connect(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); ResponseEntity response = null; HttpEntity httpEntity = new HttpEntity(headers); response = restTemplate.exchange(getBaseServiceUrl() + "/UserService1.svc/GetAllUsers", HttpMethod.POST, httpEntity, new ParameterizedTypeReference() { }); JsonElement jelement = new Gson().fromJson (response.getBody(), JsonElement.class); JsonArray jusers = jelement.getAsJsonObject().getAsJsonArray("d"); List users = new ArrayList(); for (JsonElement juser : jusers) { users.add(new Users(juser.getAsJsonObject().get("displayText").getAsString(), juser.getAsJsonObject().get("loginName").getAsString())); } return users; } private static void connect() { clientHttpRequestFactory = new SimpleClientHttpRequestFactory() { @Override protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException { super.prepareConnection(connection, httpMethod); String authorisation = company + "\" + username + ":" + password; byte[] encodedAuthorisation = Base64.encodeBase64(authorisation .getBytes()); connection.setRequestProperty("Authorization", "Basic " + new String(encodedAuthorisation)); } }; restTemplate = new RestTemplate(clientHttpRequestFactory); }[/code] The line 40 is:response = restTemplate.exchange(getBaseServiceUrl() + "/UserService1.svc/GetAllUsers", HttpMethod.POST, httpEntity, new ParameterizedTypeReference() { });[/code] Can any one tetll me what i'm doing wrong?
  2. I’m trying to use a custom data source to build some reports. I have been able to compile and deploy to Jasper server the Custom Data Source. I had created a Data Source from the Custom Data Source type. When I try to create a Domain (to be able to create an Ad Hoc View) the Data Source doesn’t show. How can I put the data from the Data Source to a report without the Domain?
×
×
  • Create New...