Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [java] log4j:WARN No appenders could be found for logger

    Il titolo della discussione è anche il mio problema.
    Ho creato un'applicazione Java che posto di seguito.

    package sample.pojo.rpcclient;

    import javax.xml.namespace.QName;

    import org.apache.axis2.AxisFault;
    import org.apache.axis2.addressing.EndpointReference;
    import org.apache.axis2.client.Options;
    import org.apache.axis2.rpc.client.RPCServiceClient;

    import sample.pojo.data.Weather;


    public class WeatherRPCClient {

    public static void main(String[] args1) throws AxisFault {



    RPCServiceClient serviceClient = new RPCServiceClient();

    Options options = serviceClient.getOptions();

    EndpointReference targetEPR = new EndpointReference(
    "http://localhost:8080/axis2/services/WeatherService");
    options.setTo(targetEPR);

    // Setting the weather
    QName opSetWeather =
    new QName("http://service.pojo.sample/xsd", "setWeather");

    Weather w = new Weather();

    w.setTemperature((float)39.3);
    w.setForecast("Cloudy with showers");
    w.setRain(true);
    w.setHowMuchRain((float)4.5);

    Object[] opSetWeatherArgs = new Object[] { w };

    serviceClient.invokeRobust(opSetWeather, opSetWeatherArgs);
    // Getting the weather
    QName opGetWeather =
    new QName("http://service.pojo.sample/xsd", "getWeather");

    Object[] opGetWeatherArgs = new Object[] { };
    Class[] returnTypes = new Class[] { Weather.class };

    Object[] response = serviceClient.invokeBlocking(opGetWeather,
    opGetWeatherArgs, returnTypes);

    Weather result = (Weather) response[0];

    if (result == null) {
    System.out.println("Weather didn't initialize!");
    return;
    }
    // Displaying the result
    System.out.println("Temperature : " +
    result.getTemperature());
    System.out.println("Forecast : " +
    result.getForecast());
    System.out.println("Rain : " +
    result.getRain());
    System.out.println("How much rain (in inches) : " +
    result.getHowMuchRain());

    }
    }
    Per essa, dato che lavoro coi WS, ho creato un file build.xml.
    Quando vado a dare il comando ant rpc.client da shell mi dà il seguente errore:

    [java] log4j:WARN No appenders could be found for logger (org.apache.axis2.util.Loader).
    [java] log4j:WARN Please initialize the log4j system properly.
    [java] org.apache.axis2.AxisFault: Connection refused
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute( ExecuteJava.java:194)
    [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:7 47)
    [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Jav a.java:201)
    [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.ja va:104)
    [java] at org.apache.tools.ant.UnknownElement.execute(Unknow nElement.java:288)
    [java] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknow n Source)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    ....
    ...
    ..
    .
    Dato che credo che l'errore sia qualcosa che mi sfugge di poco, vorrei sapere se qualcuno di voi sa cosa c'è che non vada...

  2. #2
    per completezza informo che sto lavorando con Ubuntu.
    Ho letto vari howto ma la situazione è complicata. Si parla di errato posizionamento del file log4j.properties o del file log4j.xml.
    Eppure la mia applicazione non può essere sbagliata!!! Questo perchè sto seguendo un tutorial e non sto facendo altro che seguire gli step uno dopo l'altro...
    Non so davvero più che diamine provare a fare...

  3. #3
    Davvero nessuno mi può aiutare???
    Se non sono riuscito a rendere idea di ciò che sia successo ditelo e io provvederò a dare le informazioni necessarie...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.