Skip navigation
6769 Views 11 Replies Latest reply: Aug 11, 2011 3:33 AM by sagar RSS
_sTe_ Bronze 1 posts since
Mar 20, 2009
Currently Being Moderated

Mar 20, 2009 5:12 AM

whack weather example usage

ez all

i'm pretty new with whack and i have some perplexities about the weather example...i built it, run it: now what? how i can use it? i suppose i have to write a client plugin but...

 

thanks!

  • Guenther Niess KeyContributor 305 posts since
    Jun 19, 2008
    Currently Being Moderated
    May 10, 2009 6:07 AM (in response to _sTe_)
    Re: whack weather example usage

    Hi, for testing you can use Psi for example, add your weather component in your buddy list and send him a message with a weather station from http://weather.noaa.gov/ (see the attached screenshot).But for a comfortable usage, yeah, maybe you can write a client

    Attachments:
  • ayyrk Bronze 9 posts since
    Jul 27, 2007
    Currently Being Moderated
    Jun 25, 2009 5:57 AM (in response to _sTe_)
    Re: whack weather example usage

    I read that the weather example was in a sample folder in the source. I downloaded the source zip and did not find it.

     

    Q: Where are you getting the weather example these days?

     

    Thanks,

    • Guenther Niess KeyContributor 305 posts since
      Jun 19, 2008
      Currently Being Moderated
      Jun 25, 2009 6:08 AM (in response to ayyrk)
      Re: whack weather example usage

      You can get it via subversion

       

      svn co http://svn.igniterealtime.org/svn/repos/whack/trunk whack
      

       

      But currently I think you can't compile the trunk if you don't fix some old references. See my attached patch to compile and run the actual revision (11087).

       

      Best regards

      Attachments:
      • ayyrk Bronze 9 posts since
        Jul 27, 2007
        Currently Being Moderated
        Jun 25, 2009 11:21 AM (in response to Guenther Niess)
        Re: whack weather example usage

        I changed the whack.jar build compile target includes in order to pick up the xmpp classes. That allowed me to use whack.jar in my component project. I hope I'm on the right track..

        Thanks!

         

         

        <target name="jar" depends="compile" unless="jar.uptodate" description="Produces whack.jar">
                <jar destfile="${jar.dest.dir}/whack.jar"
                     basedir="${compile.dir}"
                     includes="org/**/*.class" />
                  <!-- includes="org/jivesoftware/whack/**/*.class" -->
        </target>

        • ayyrk Bronze 9 posts since
          Jul 27, 2007
          Currently Being Moderated
          Jun 25, 2009 12:24 PM (in response to ayyrk)
          Re: whack weather example usage

          1) I rebuild whack.jar from SVN - just needed to modify the build.xml to include more classes in whack.jar.

           

          2) I got the weather sample to compile against these jars:

           

              commons-httpclient.jar

              dom4j.jar      

              jweather.jar

              tinder-1.0.0.jar

              xpp3.jar
              commons-logging.jar   

              jakarta-oro.jar

              log4j.jar   

              whack.jar

           

          2) When I try to run the weather example I get:

           

          Exception in thread "main" java.lang.NoClassDefFoundError: org/jivesoftware/stringprep/IDNA
                  at org.xmpp.packet.JID.init(JID.java:369)
                  at org.xmpp.packet.JID.<init>(JID.java:248)
                  at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentM anager.java:212)
                  at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentM anager.java:191)
                  at org.jivesoftware.weather.ExternalWeatherComponent.main(ExternalWeatherComponent .java:32)
          Caused by: java.lang.ClassNotFoundException: org.jivesoftware.stringprep.IDNA
                  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                  ... 5 more

           

          3) It looks like the missing class is required by the tinder jar. My goal is to run the weather example.

          • ayyrk Bronze 9 posts since
            Jul 27, 2007
            Currently Being Moderated
            Jun 25, 2009 12:31 PM (in response to ayyrk)
            Re: whack weather example usage

            Woops, sorry - found stringprep.jar to fix my runtime problem

             

            Weather example is running, thanks!

          • Guenther Niess KeyContributor 305 posts since
            Jun 19, 2008
            Currently Being Moderated
            Sep 15, 2009 9:30 AM (in response to ayyrk)
            Re: whack weather example usage

            I fixed the current trunk version of whack for the updated API and libraries.

            • Stefano Bronze 26 posts since
              Feb 9, 2011
              Currently Being Moderated
              Mar 19, 2011 7:53 AM (in response to Guenther Niess)
              Re: whack weather example usage

              Got to bump this discussion up.

               

              I just downloaded the whack trunk from svn (rev 12148), it seems I cannot build it using ant.

               

               

              pongells:build fusionove$ ant
              Buildfile: /Users/fusionove/whack/build/build.xml
              
              
              compile:
                  [javac] Compiling 21 source files to /Users/fusionove/whack/target/classes
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:23: package org.eclipse.jetty.server does not exist
                  [javac] import org.eclipse.jetty.server.Server;
                  [javac]                                ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:24: package org.eclipse.jetty.server.nio does not exist
                  [javac] import org.eclipse.jetty.server.nio.SelectChannelConnector;
                  [javac]                                    ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:25: package org.eclipse.jetty.server.ssl does not exist
                  [javac] import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
                  [javac]                                    ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:26: package org.eclipse.jetty.webapp does not exist
                  [javac] import org.eclipse.jetty.webapp.WebAppContext;
                  [javac]                                ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:52: cannot find symbol
                  [javac] symbol  : class Server
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]     private Server jetty;
                  [javac]             ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:105: cannot find symbol
                  [javac] symbol  : class Server
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]             jetty = new Server();
                  [javac]                         ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:115: cannot find symbol
                  [javac] symbol  : class SelectChannelConnector
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]             SelectChannelConnector connector0 = new SelectChannelConnector();
                  [javac]             ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:115: cannot find symbol
                  [javac] symbol  : class SelectChannelConnector
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]             SelectChannelConnector connector0 = new SelectChannelConnector();
                  [javac]                                                     ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:131: cannot find symbol
                  [javac] symbol  : class SslSelectChannelConnector
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]                           SslSelectChannelConnector listener = new SslSelectChannelConnector();
                  [javac]                           ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:131: cannot find symbol
                  [javac] symbol  : class SslSelectChannelConnector
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]                           SslSelectChannelConnector listener = new SslSelectChannelConnector();
                  [javac]                                                                    ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:192: cannot find symbol
                  [javac] symbol  : class WebAppContext
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]             WebAppContext webapp = new WebAppContext();
                  [javac]             ^
                  [javac] /Users/fusionove/whack/source/java/org/jivesoftware/whack/container/ServerContainer.java:192: cannot find symbol
                  [javac] symbol  : class WebAppContext
                  [javac] location: class org.jivesoftware.whack.container.ServerContainer
                  [javac]             WebAppContext webapp = new WebAppContext();
                  [javac]                                        ^
                  [javac] Note: Some input files use or override a deprecated API.
                  [javac] Note: Recompile with -Xlint:deprecation for details.
                  [javac] Note: Some input files use unchecked or unsafe operations.
                  [javac] Note: Recompile with -Xlint:unchecked for details.
                  [javac] 12 errors
              
              
              BUILD FAILED
              /Users/fusionove/whack/build/build.xml:95: Compile failed; see the compiler error output for details.
              
              
              Total time: 2 seconds
              pongells:build fusionove$ 
              
              

               

              Any suggestion here?

              Thanks.

              • Stefano Bronze 26 posts since
                Feb 9, 2011
                Currently Being Moderated
                Mar 19, 2011 12:19 PM (in response to Stefano)
                whack weather example usage

                Oh well, I just downloaded the whole jetty distribution and put each jar inside the lib/merge folder... not sure wether this was a good idea, but it worked.

                 

                The Whack 1.0.jar which can be found on this website doesn't work anymore (missing Log class, at least) - maybe someone should update it?

                 

                For this weather example, the jweather.jar was missing, too.

                • sagar Bronze 6 posts since
                  Apr 12, 2010
                  Currently Being Moderated
                  Aug 11, 2011 3:33 AM (in response to Stefano)
                  whack weather example usage

                  I have another solution for compiling the Whack library.Just download "jetty-all-server-7.0.2.RC0.jar" and add build/ merge and run the ant file. This worked for me and had written a sample external component and thats working fine.

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points