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

aamitt06

Members
  • Posts

    34
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Posts posted by aamitt06

  1. Well I have resolved the issue initially what I was doing is using the command

    root@ubuntu:pg_dump --username=postgres --host=127.0.0.1 --port=5433 jasperserver > /home/user/JS_55_Backup.sql

    the problem with it was that  there was another pg_dump on linux server which was of higher version and bundled postgresql of JasperServer uses 9.0.4 postgresql , to resolve this issue I gave the path of pg_dump inside jasperserver i.e

    root@ubuntu:~#  /opt/jasperreports-server-cp-5.5.0/postgresql/bin/pg_dump --username=postgresql --host-127.0.0.1 --port=5433 jasperserver > /home/user/JS_55_Backup.sql

     

  2. I resolved the issue the mistake i was doing was that in String input = "{"username":"AgentUser22", ... instead of username it should be fullName and the correct fromat of descriptor should be

     

     String input = "{"fullName":"AgentUser22","password":"jasperadmi","emailAddress":"aamitt06@gmail.com","tenantid":"Ag","enabled":true,

    "externallyDefined":false,"roles":[{"name":"ROLE_USER"},{"name":"ROLE_VOUCHER"}]}";

    JSONObject jObject  = new JSONObject(input);

     

    Rest would be the same as above.

  3. I am trying to create user by following JasperServer rest api I am using JasperServer version 5.6.0  ,when I am passing put request with json data I am getting 400 Bad Request error

     

     Authenticator.setDefault(new Authenticator() {
      @Override

    protected PasswordAuthentication getPasswordAuthentication() {

    return new PasswordAuthentication("jasperadmin", "jasperadmin".toCharArray());


                }


            });

     String input = "{"username":"AgentUser22","password":"jasperadmi","fullname":"Agent User","emailAddress":"aamitt06@gmail.com","enabled":true,"externallyDefined":false,"roles":[{"name":"ROLE_AGENT"}]}";


            JSONObject jObject  = new JSONObject(input);

             ClientResponse response = service.path("rest_v2").path("users").path("AgentUser22").type("application/json")                .put(ClientResponse.class,jObject);'


              System.out.println(jObject);


               if (response.getStatus() != 201) {


                throw new RuntimeException("Failed : HTTP error code : "  + response.getStatus());


            }

  4.  

     

     

    SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-apr-8009"]

    java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.

    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:446)

    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)

    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)

    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

    at org.apache.catalina.startup.Catalina.load(Catalina.java:640)

    at org.apache.catalina.startup.Catalina.load(Catalina.java:665)

    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.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)

    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

     

    Sep 18, 2014 10:52:55 PM org.apache.catalina.core.StandardService initInternal

    SEVERE: Failed to initialize connector [Connector[AJP/1.3-8009]]

    org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]]

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)

    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

    at org.apache.catalina.startup.Catalina.load(Catalina.java:640)

    at org.apache.catalina.startup.Catalina.load(Catalina.java:665)

    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.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)

    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

    Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed

    at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

    ... 12 more

    Caused by: java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.

    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:446)

    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)

    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)

    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)

    ... 13 more

     

     

     

     

     

  5. I resolved the issue by making customized BarRenderer class here is what I did to resolve this:

      public void customize(JFreeChart chart, JRChart jasperChart) {
               
            //Set the Customized Bar Renderer
            CustomBarRenderer renderer = new CustomBarRenderer();
            chart.getCategoryPlot().setRenderer((CategoryItemRenderer) renderer);
             
        }

     

    And Here is code for customized bar renderer class:

     

    public class CustomBarRenderer extends BarRenderer  {
        
        public CustomBarRenderer(){
           // super(
        }
        @Override
        public Paint getItemPaint(int row,int column){

            CategoryDataset dataset = getPlot().getDataset();
            
            if(dataset!=null)
            {
            Number maximum = DatasetUtilities.findMaximumRangeValue(dataset);
            Number minimum = DatasetUtilities.findMinimumRangeValue(dataset);
                    
            double l_value  = dataset.getValue(row, column).doubleValue();
            if(l_value==(double)minimum)
            {
                return Color.RED;
            }
            else if(l_value==(double)maximum) {
                return Color.GREEN;
            }
            
            }     
                return Color.GRAY;   
          }

    }
     

  6. You should create a barchart customizer class to control width of bar chart and use the setMaximumBarWidth attribute


    CategoryPlot categoryPlot=chart.getCategoryPlot();
    BarRenderer renderer=(BarRenderer)categoryPlot.getRenderer();
    renderer.setMaximumBarWidth(.30);  //Set maximum width of barchart to 30 percent

×
×
  • Create New...