title: java SHOUTcast: i have error with BasicPlayer
body: <p>i want to create a program to play shoutcast stream.
  i copy this code from <a href="https://stackoverflow.com/questions/9332484/javazoom-player-wont-work-on-windows-with-shoutcast-stream-says-invalid-https-r">here</a> and i heve the below error message.
  i use BasicPlayer library, if you have any other library to suggest, it will be very helpful to me!</p>
  
  <pre><code>import java.net.MalformedURLException;
  import java.net.URL;
  import java.util.Map;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  import javazoom.jlgui.basicplayer.BasicController;
  import javazoom.jlgui.basicplayer.BasicPlayer;
  import javazoom.jlgui.basicplayer.BasicPlayerEvent;
  import javazoom.jlgui.basicplayer.BasicPlayerException;
  import javazoom.jlgui.basicplayer.BasicPlayerListener;
  
  public class MP3Player implements BasicPlayerListener, Runnable {
  
      public String streamurl;
      public BasicController playerControl;
      private BasicPlayer player;
      private volatile boolean shouldPlay = true;
  
      @Override
      public void run() {
          while (true) {
              if (shouldPlay) {
                  player();
              }
          }
      }
  
      public void start() {
          new Thread(this).start();
      }
  
      public void pause() {
  
          shouldPlay = false;
  
          try {
              playerControl.stop();
          } catch (BasicPlayerException ex) {
              Logger.getLogger(MP3Player.class.getName()).log(Level.SEVERE, null,
                      ex);
          }
  
      }
  
      public void play() {
          shouldPlay = true;
      }
  
      public MP3Player(String givenStreamurl) {
          streamurl = givenStreamurl;
      }
  
      public void player() {
  
          shouldPlay = false;
          player = new BasicPlayer();
          playerControl = (BasicController) player;
          player.addBasicPlayerListener(this);
          try {
              try {
                  playerControl.open(new URL(streamurl));
              } catch (MalformedURLException ex) {
                  System.out.println("aaa");
              }
              playerControl.play();
              playerControl.setGain(0.85);
              playerControl.setPan(0.0);
          } catch (BasicPlayerException ex) {
          }
  
      }
  }
  </code></pre>
  
  <p>error message</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
      at javazoom.jlgui.basicplayer.BasicPlayer.&lt;clinit&gt;(Unknown Source)
      at MP3Player.player(MP3Player.java:57)
      at Main.main(Main.java:6)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 3 more
  </code></pre>
  
  <p>line 57 is </p>
  
  <blockquote>
    <p>player = new BasicPlayer();</p>
  </blockquote>
  
  <p>thanx!</p>