Menu

Null pointer exception

SendMMS
2008-12-04
2013-05-01
  • BinarySpike

    BinarySpike - 2008-12-04

    Hello, I am setting up SendMMS to try to send an MMS over TCP/UDP to the alltel WAP/MMS gateway to my cellphone.  So I don't have to use alltel's proprietary axcessmypics.com

    I want to set this up on my gentoo server I built so I can e-mail my computer and then it will parse the e-mail into a subject, text, and possibly an image.  Then send the mms to my cellphone, or vice versa, send an e-mail from my cellphone to my gentoo server and have it upload images to facebook.
    (I'm explaining this so that you can tell me right off if SendMMS won't work for me etc. etc.)

    I'm doing this on Windows XP but I will be moving to gentoo linux, here's my error

    I had to move \build\net to \dist\ to enable SendMMS to run (it was complaining that there was no classes or something)  this was not documented

    I did that and now it's getting a null pointer exception, when I try to run SendMMS

    Exception in thread "main" java.lang.NullPointerException
    at net.sourceforge.jmmslib.MmsMessage.isDeliveryReportEnabled(Unknown Source)
    at net.sourceforge.jmmslib.MmsEncoder.encodeMessage(Unknown Source)
    at net.sourceforge.jmmslib.sendmms.SendMms.buildMMS(SendMms.java:203)
    at net.sourceforge.jmmslib.sendmms.SendMms.main(SendMms.java:422)

    usage is
    snedmms <my cell number> -t test

    sendmms.properties is
    waphost="75.116.124.4"
    wapport=9201
    mmsservlet="http://mms-mt.alltel.net/servlets/mms"
    sender="<insert e-mail here>"
    subject="Testing"
    textMaxSize=200
    mmsMaxSize=500

    Any ideas how I can get this to run?

    Thanks,
      Nathan

     
    • Andrea Zito

      Andrea Zito - 2008-12-04

      Ok, first of all SendMMS is supposed to be used with a WAP gateway thought the WAP protocol. I don't know alltel so I cannot say if SendMMS will work with it or not.

      In your explanation you mention a lot of stuff you want to do. It sounds feasible but you'll have to write a lot of glue around SendMMS to make it do what you want as it will only send MMS containing text and images, nothing more... The problem you encountered with ClassNotFoundException at runtime is due to my lack of knowledge about Windows batch scripting. That script is supposed to add to the classpath the libraries in the libs directory and then start the program. It may well be the case that I've made some error in the script, try to invoke it manually adding the libraries to the classpath or simply use the unix script which I had chance to test. Copying the src/net folder to dist is not required.

      Now the error you're encountering is quite strange, I quickly looked at the code but I can't figure out what could trigger that exception. If you're willing to, you could try to download jMmsLib sources and compile them with debugging symbols (change build_debug property to true in build.xml and then run ant). Do the same for SendMMS, redo the test and then post the stack trace. With those information it'll be easier to understand the problem.

      Thanks,
      Cheers Andrea

       
    • BinarySpike

      BinarySpike - 2008-12-04

      Okay I made an update to your bat which fixed the problem.  The issue was it wasn't including sendmms.jar to your classpath

      java -cp libs/JmmsLib-0.8.jar;libs/jWAP.jar;sendmms.jar;. -DconfFile=./sendmms.properties net.sourceforge.jmmslib.sendmms.SendMms %*

      You are using unix style line endings, and the javadocs say to use colon's not semi-colons (but however, colons DO NOT WORK)

      Very confusing.

      Anyway I compiled jMmsLib with debug information, but I don't know how to get stack trace... I'll go google that and report back

       
    • BinarySpike

      BinarySpike - 2008-12-05

      I can't seem to find any way to get stack trace information from java without editing the code itself to print it out when the error occurs.

      However with jmmslib compiled with debug symbols, it tells line codes on the error.  Instead of "(Unknown Source)"  So I'll give you that.

      Exception in thread "main" java.lang.NullPointerException
              at net.sourceforge.jmmslib.MmsMessage.isDeliveryReportEnabled(MmsMessage.java:819)
              at net.sourceforge.jmmslib.MmsEncoder.encodeMessage(MmsEncoder.java:546)
              at net.sourceforge.jmmslib.sendmms.SendMms.buildMMS(SendMms.java:203)
              at net.sourceforge.jmmslib.sendmms.SendMms.main(SendMms.java:422)

      Do you know how to get the stack trace?

       
      • Andrea Zito

        Andrea Zito - 2008-12-05

        Actually this is what I needed... When I have a minute I'll try to reproduce the error and fix it.

        You confirm me that you get this error when you try to send an MMS this way:
        sendmms <my cell number> -t test

        I'll take a look at it this week end if I can find some spare time, in the meanwhile if you can, try the same on your gentoo box (or any unix box for what that matter) and tell me if you got the same error. I ask this 'couse the test you perform is so simple that there shouldn't really be problems at all, maybe I messed up the code in such a way that it has problem with windows (I haven't had chances to test it on windows yet).

        Thanks,
        Cheers Andrea

         
    • Ing Andrea Lagomarsini

      The problem is inside the sender...

      There are two Boolean object not intitilized.. so you have to initialized them

      = new Boolean("true");

       
      • Andrea Zito

        Andrea Zito - 2009-03-20

        Yeah, actually I did catch the problem some time ago and fixed it.
        The updated code is in the hg repository. I'll take the time to assemble a new release as soon as possible.

        PS: Also i need to fix the mercurial repository (which I see does not work anymore) and exploit the new official support of sourceforge.

        Bye Andrea

         
    • Ing Andrea Lagomarsini

      I have solved the problem.. but if you can give me your update.. i ll use official release...

      Andrea

       
      • Andrea Zito

        Andrea Zito - 2009-03-20

        I've assembled a new release for both jMmsLib and SendMMS.
        Specifically jMmsLib v 0.8.1 which fixes the bug and SendMMS v. 1.0.1 which use the new version of jMmsLib.

        Just grab the last release of the component you need in the download page of the project.

        Cheers Andrea

         
    • Ing Andrea Lagomarsini

      great!

       
    • roccos

      roccos - 2009-04-10

      Hi,

      first of all WELL DONE! No, really... there's no such tool as far as I was able to google out :)

      I've downloaded SendMMS v.1.0.1, but I'm facing exactly the same problem:

      Exception in thread "main" java.lang.NullPointerException
              at net.sourceforge.jmmslib.MmsMessage.isDeliveryReportEnabled(Unknown Source)
              at net.sourceforge.jmmslib.MmsEncoder.encodeMessage(Unknown Source)
              at net.sourceforge.jmmslib.sendmms.SendMms.buildMMS(SendMms.java:203)
              at net.sourceforge.jmmslib.sendmms.SendMms.main(SendMms.java:422)

      when I tried to send MMS by:  ./sendmms "+386××××××××" -s test -t something or even without ". Is it possible I've made some mistake?

      I've deployed it on a Linux Debian machine.
      Thank you in advance!

      Regards,
      Rok

       
    • zick zack

      zick zack - 2009-04-21

      Hello Rok,

      do you have build a new "jMmsLib-0.8.1.jar". I had the same problem. After I build it new it was ok. The file jMmsLib-0.8.jar in SendMms-1.0.1\libs is not up to date.

      Regards

      zickzack11

       

Log in to post a comment.