Jump to content


Voice message could not be uploaded


  • You cannot reply to this topic
14 replies to this topic

#1 udkl

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 15 February 2009 - 05:33 AM

The Applet seems great and recordes the voice input perfectly.
It fails at uploading tht voice file to the server though.

I read and reread the documentation and installation instructions, and I concluded that the error lies with an exception in the servlet code somewhere.


Using the WAV recorder and the "WAV_JBOSS_JSP" files. But instead of JBOSS, using Weblogic.(Should'nt matter I suppose).
Using a local server with url "localhost:7001"

Here is the Java Console output. It has the output of 2-3 tries of reloading and rerecording.


CODE
Java(TM) Plug-in: Version 1.4.1_06
Using JRE version 1.4.1_06 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Toxic
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
uploadVoiceMsg: voiceBuffer size = 13440

http://localhost:7001/rpappletserverscript/rpappletserverscript

IOException

Exception at uploadingjava.lang.NullPointerException

java.lang.NullPointerException

    at java.io.DataInputStream.readLine(Unknown Source)

    at ba.d(ba.java)

    at ba.b(ba.java)

    at ba.a(ba.java)

    at ba.run(ba.java)

    at java.lang.Thread.run(Unknown Source)

Stopped

uploadVoiceMsg: voiceBuffer size = 13440

http://localhost:7001/rpappletserverscript/rpappletserverscript

IOException

Exception at uploadingjava.lang.NullPointerException

java.lang.NullPointerException

    at java.io.DataInputStream.readLine(Unknown Source)

    at ba.d(ba.java)

    at ba.b(ba.java)

    at ba.a(ba.java)

    at ba.run(ba.java)

    at java.lang.Thread.run(Unknown Source)

Start Record

Stopped

Start Play

Stopped

uploadVoiceMsg: voiceBuffer size = 107520

http://localhost:7001/rpappletserverscript/rpappletserverscript

IOException

Exception at uploadingjava.lang.NullPointerException

java.lang.NullPointerException

    at java.io.DataInputStream.readLine(Unknown Source)

    at ba.d(ba.java)

    at ba.b(ba.java)

    at ba.a(ba.java)

    at ba.run(ba.java)

    at java.lang.Thread.run(Unknown Source)

OS: Windows XP

VERSION:1.3.12

Wav Dll version

DEMO_VERSION

Maximal time of record is 0:0:20

Loading library C:\Documents and Settings\Toxic\jaudioWavWin.tar...

Library loaded...

Start Record

Stopped

uploadVoiceMsg: voiceBuffer size = 15120

http://localhost:7001/rpappletserverscript/rpappletserverscript

IOException

Exception at uploadingjava.lang.NullPointerException

java.lang.NullPointerException

    at java.io.DataInputStream.readLine(Unknown Source)

    at ba.d(ba.java)

    at ba.b(ba.java)

    at ba.a(ba.java)

    at ba.run(ba.java)

    at java.lang.Thread.run(Unknown Source)




Hope it's not much of a difficulty for you guys.



#2 Sergey

    Advanced Member

  • Moderators
  • PipPipPip
  • 298 posts
  • Gender:Male
  • Location:Kyiv, Ukraine

Posted 16 February 2009 - 04:10 PM

You use Java Plug-in Version 1.4.1_06. It is not so new. Last version is 1.6. Please update it. If this problem will be again, please contact me.
Thanks.
Sergey



#3 udkl

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 19 February 2009 - 04:20 AM

CODE
Java Plug-in 1.6.0_12
Using JRE version 1.6.0_12 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Toxic
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------


OS: Windows XP
VERSION:1.3.12
Wav Dll version
DEMO_VERSION
Maximal time of record is 0:0:20
Loading library C:\Documents and Settings\Toxic\jaudioWavWin.tar...
Library loaded...
Start Record
Stopped
uploadVoiceMsg: voiceBuffer size = 26880
http://localhost:7001/rpappletserverscript/rpappletserverscript
IOException
Exception at uploadingjava.lang.NullPointerException
java.lang.NullPointerException
    at java.io.DataInputStream.readLine(Unknown Source)
    at ba.d(ba.java)
    at ba.b(ba.java)
    at ba.a(ba.java)
    at ba.run(ba.java)
    at java.lang.Thread.run(Unknown Source)
uploadVoiceMsg: voiceBuffer size = 26880
http://localhost:7001/rpappletserverscript/rpappletserverscript
IOException
Exception at uploadingjava.lang.NullPointerException
java.lang.NullPointerException
    at java.io.DataInputStream.readLine(Unknown Source)
    at ba.d(ba.java)
    at ba.b(ba.java)
    at ba.a(ba.java)
    at ba.run(ba.java)
    at java.lang.Thread.run(Unknown Source)




Seregy, Please can you provide me with the source code of the java servlets where the error is occuring ? The code of the corrosponding php file is available to everyone. .

A big thank you for helping me out over here.

#4 Sergey

    Advanced Member

  • Moderators
  • PipPipPip
  • 298 posts
  • Gender:Male
  • Location:Kyiv, Ukraine

Posted 19 February 2009 - 05:09 PM

Please send me source code of applet call. I need to know applet parameters values
Thanks.

#5 udkl

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 20 February 2009 - 04:50 AM

For good measure, I included the whole page and highlighted the applet part.





<html>
<head>
<title>Wav Voice Recording Applet SDK</title>
<script language="JavaScript">
var optionNo = 0
var UserServerFolder = "fox"

function vision()
{
STOP_RP();
document.getElementById("loading").style.visibility="hidden";
document.getElementById("loaded").style.visibility="visible";
}

function fileLoaded()
{
alert("file loaded!");
}

function report_RP(s,num)
{
alert(s);
}

function setRecordLevel(num){}

function setStatus_RP(str,num)
{
document.Gui_RP.Status.value = str;
if(num==7) fileLoaded();
}

function setTimer_RP(s) {
document.Gui_RP.Timer.value = s;
}

function confirmRecord(s, num) {
if(confirm(s))
RECORD_RP();
else
STOP_RP();
}

function addName(s) {
var newOpt = new Option(String(s),String(s));
var VILength = document.Gui_RP.VoiceItems.length;
document.Gui_RP.VoiceItems.options[VILength] = newOpt;
document.Gui_RP.FileName.value = "*.wav";
}

function RECORD_RP() {
document.RPApplet.RECORD();
}

<!-- ************* EXAMPLE **************************************************************** -->
function setparameter() {
document.RPApplet.SETPARAMETER(String("bla"),String("BLABLA"));
}
<!-- ************* EXAMPLE **************************************************************** -->



function PLAYBACK_RP() {
document.RPApplet.PLAYBACK();
}

function PAUSE_RP() {
document.RPApplet.PAUSE();
}

function STOP_RP() {
document.RPApplet.STOP_RP();
}

function UPLOAD_RP() {
document.RPApplet.UPLOAD(String(document.Gui_RP.FileName.value));
}

function WEBPLAY_RP() {
document.RPApplet.WEBPLAY(UserServerFolder + "/" + document.Gui_RP.VoiceItems.value);
}

</script>
</head>
<body>
<SPAN ID="loading" style="visibility:visible">
<TABLE border="0">

<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Loading Java applet...</TD>
</TR>
</TABLE>
</SPAN> <SPAN ID="loaded" style="visibility:visible">
<FORM name="Gui_RP" onSubmit="event.returnValue=false;return false;">
<TABLE CELLSPACING=1 style="color:#000000;font-family:Tahoma;font-size:10pt" border="0">
<TR>
<TD> Recorder</TD>

<TD><input TYPE=button VALUE="Record" STYLE="width:70;font-family:Tahoma;font-size:10pt" onClick="RECORD_RP();"></TD>
<TD width="70"><input TYPE=button VALUE="Play" STYLE="width:70;font-family:Tahoma;font-size:10pt" onClick="PLAYBACK_RP();"></TD>
<TD width="70"><input TYPE=button VALUE="Pause" STYLE="width:70;font-family:Tahoma;font-size:10pt" onClick="PAUSE_RP();"></TD>
<TD><input TYPE=button VALUE="Stop" STYLE="width:70;font-family:Tahoma;font-size:10pt" onClick="STOP_RP();"></TD>
</TR>
<TR>
<TD COLSPAN=2>Please enter file name</TD>
<TD ALIGN=right COLSPAN=2><input TYPE=text NAME="FileName" VALUE="*.wav" SIZE=20 MAXLENGTH=16 style="width:150;font-family:Tahoma;font-size:10pt"></TD>

<TD><input TYPE=button VALUE="Send" STYLE="width:70" onClick="UPLOAD_RP();">
<!-- ************* EXAMPLE **************************************************************** -->
<!-- <input TYPE=button VALUE="set" STYLE="width:70" onClick="setparameter();">-->
<!-- ************* EXAMPLE **************************************************************** -->
</TD>
</TR>
<TR>
<TD COLSPAN=2>Listen from Web-server</TD>

<TD ALIGN=right COLSPAN=2><SELECT ID="VoiceItems" SIZE=1 style="width:150;font-family:Tahoma;font-size:10pt">
</SELECT>
</TD>
<TD ALIGN=MIDDLE><input TYPE=button VALUE="Listen" STYLE="width:70" onClick="WEBPLAY_RP();"></TD>
</TR>
<TR>
<TD>Status</TD>
<TD COLSPAN=3><input TYPE=text NAME="Status" VALUE="" SIZE=34 MAXLENGTH=60 style="width:240;font-family:Tahoma;font-size:10pt"></TD>

<TD><input TYPE=text NAME="Timer" SIZE=15 ></TD>
</TR>
</TABLE>
</FORM>
</SPAN>
CODE
<APPLET    CODE="RPApplet.class"
                ARCHIVE="RPAppletWav.jar"
                CODEBASE="."
                ALIGN="MIDDLE" width=380 height=24
                NAME="RPApplet"
                MAYSCRIPT>
  <PARAM NAME = "cabbase"    VALUE = "RPAppletWav.cab">
  <PARAM NAME = "Registration"    VALUE = "DEMO">
  <PARAM NAME = "ServerScript"    VALUE = "http://localhost:7001/rpappletserverscript/rpappletserverscript">
  <PARAM NAME = "VoiceServerFolder"    VALUE = "/../voicefiles/">

  <PARAM NAME = "TimeLimit"    VALUE = "1800">
  
  <PARAM NAME = "BlockSize"    VALUE = "10240">
  <PARAM NAME = "InterfaceType"        VALUE = "JS">
  <PARAM NAME = "UserServerFolder"    VALUE = "fox">
  <PARAM NAME = "UserPostVariables"    VALUE = "name,country">
  <PARAM NAME = "name"            VALUE = "miha">
  <PARAM NAME = "country"            VALUE = "Ukraine">
  <PARAM NAME = "Sampling_frequency"    VALUE = "8000">
  <param name = "AudioFormat"             value = "wav">

   <PARAM NAME = "backgroudColor" value = "c0c0c0">
   <PARAM NAME = "indicatorLevel1" value = "4664f0">
   <PARAM NAME = "indicatorLevel2" value = "28c814">
   <PARAM NAME = "indicatorLevel3" value = "f03250">
   <PARAM NAME = "indicatorWidth" value = "380">
</APPLET>

</td>
</tr>
</table>
</body>
</html>



#6 Sergey

    Advanced Member

  • Moderators
  • PipPipPip
  • 298 posts
  • Gender:Male
  • Location:Kyiv, Ukraine

Posted 20 February 2009 - 05:33 PM

unfortunately that information you gave me is not enough. Please, send me server console after error was occured. I would like to analize it. Thanks.


#7 udkl

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 22 February 2009 - 03:41 PM

QUOTE (Sergey @ Feb 20 2009, 05:33 PM) <{POST_SNAPBACK}>
unfortunately that information you gave me is not enough. Please, send me server console after error was occured. I would like to analize it. Thanks.



The server console does not have any messages. It remains blank.

Once, it did give a " /voicefiles/ not found " kinda error. It dosen't give it now though.
Wish I could peek into the source code that deals only with uploading.....

#8 Sergey

    Advanced Member

  • Moderators
  • PipPipPip
  • 298 posts
  • Gender:Male
  • Location:Kyiv, Ukraine

Posted 23 February 2009 - 09:50 AM

Please, put the demo of recording applet on the server which is accessible for me and give me login&password to it.
We will figure out why applet can not upload audio file on the server.

#9 Joel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 09 April 2009 - 02:09 PM

I seem to be getting the same error using the demo applet downloaded from your site:

CODE
Java Plug-in 1.6.0_13
Using JRE version 1.6.0_13 Java HotSpot(TM) Client VM
User home directory = C:\Users\jcorra
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
OS: Windows Vista
VERSION:1.3.20.4
Wav Dll version
DEMO_VERSION
Maximal time of record is 0:0:20
current Java specification version: 1.6
local file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
remote file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
Loading library C:\Users\jcorra\AppData\Local\Temp\\Vimas\\jaudioWavWin.tar...
Library loaded...
Library version : 228
local file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
remote file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
Start Record
Stopped
sample frequency 8000
Start Play
oldUploadVoiceMsg()
oldGetPostDataInputStream
Exception at uploadVoiceMsg
java.lang.NullPointerException
    at java.io.DataInputStream.read(Unknown Source)
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at java.io.BufferedReader.fill(Unknown Source)
    at java.io.BufferedReader.readLine(Unknown Source)
    at java.io.BufferedReader.readLine(Unknown Source)
    at n.c(Unknown Source)
    at n.b(Unknown Source)
    at n.a(Unknown Source)
    at n.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


I'm using the applet embedded in an HTML page. The page it's supposed to be trying to upload to is never touched--no requests for that page appear anywhere in my web server's logs. Here's the applet tag in my page:

CODE
<applet code="RPApplet.class" archive="RPAppletWav.jar" codebase="./WAV_RecApplet"
    align="middle" width="288" height="18" name="RPApplet" mayscript>
    <param name="cabbase" value="RPAppletWav.cab" />
    <param name="ServerScript" value="http://localhost/PTWebTest/Members/MessageUploadHandler.ashx" />
    <param name="VoiceDestPath" value="http://localhost/PTWebTest/Members/Messages/" />
    <param name="Registration" value="demo" />
    <param name="TimeLimit" value="18000" />
    <param name="Sampling_frequency" value="8000" />
    <param name="AudioFormat" value="MuLaw" />
    <param name="backgroudColor" value="d4d0c8" />
    <param name="indicatorLevel1" value="4664f0" />
    <param name="indicatorLevel2" value="28c814" />
    <param name="indicatorLevel3" value="f03250" />
    <param name="indicatorWidth" value="374" />
</applet>


#10 Sergey

    Advanced Member

  • Moderators
  • PipPipPip
  • 298 posts
  • Gender:Male
  • Location:Kyiv, Ukraine

Posted 10 April 2009 - 03:36 PM

We did some modification of applet. Applet file is attached to this post. Unzip it before using. Inform me about result.

Attached Files



#11 Joel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 15 April 2009 - 05:37 PM

QUOTE (Sergey @ Apr 10 2009, 11:36 AM) <{POST_SNAPBACK}>
We did some modification of applet. Applet file is attached to this post. Unzip it before using. Inform me about result.


Now I'm getting a different error:

CODE
Java Plug-in 1.6.0_13
Using JRE version 1.6.0_13 Java HotSpot(TM) Client VM
User home directory = C:\Users\jcorra

OS: Windows Vista
VERSION:1.3.20.4
Wav Dll version
DEMO_VERSION
Maximal time of record is 0:0:20
Background color =  (212, 208, 200)
current Java specification version: 1.6
local file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
remote file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
Loading library C:\Users\jcorra\AppData\Local\Temp\\Vimas\\jaudioWavWin.tar...
Library loaded...
Library version : 228
local file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
remote file hash: 39a55dbc2471c98bd567d2599ea9a21483bc4d22
Start Record
Stopped
oldUploadVoiceMsg()
oldGetPostDataInputStream
http://localhost/PTWebTest/Members/MessageUploadHandler.ashx
Exception at uploadVoiceMsg
java.security.AccessControlException: access denied (java.util.PropertyPermission http.strictPostRedirect read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at java.lang.Boolean.getBoolean(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.followRedirect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at UploadFile.oldGetPostedDataInputStream(UploadFile.java:403)
    at UploadFile.getPostedDataInputStream(UploadFile.java:331)
    at UploadFile.oldUploadVoiceMsg(UploadFile.java:103)
    at UploadFile.uploadVoiceMsg(UploadFile.java:87)
    at UploadFile.uploading(UploadFile.java:66)
    at UploadFile.run(UploadFile.java:55)
    at java.lang.Thread.run(Unknown Source)


#12 Sergey

    Advanced Member

  • Moderators
  • PipPipPip
  • 298 posts
  • Gender:Male
  • Location:Kyiv, Ukraine

Posted 22 April 2009 - 03:29 PM

Applet can upload files only on server that it was loaded from. So if you try to upload files on "localhost" you should load applet from web page on "localhost". Maybe you run web page with embeded applet by doubleclicking and web page loads by "file:///..." protocol instead of "http://localhost/.."

#13 Joel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 22 April 2009 - 03:43 PM

No, I am definitely loading the webpage that contains the applet from http://localhost, and trying to upload to http://localhost

#14 Joel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 22 April 2009 - 04:10 PM

Ok, it looks like the behavior did change with the update you provided. I do now see the POST in my server's log files.

The request was still failing because the page which I had set up to handle the upload was in a directory that required authentication. I moved the page for handling the upload to a directory that allows anonymous access, and now it looks like it's working as expected.

Thanks!

#15 Joel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 23 April 2009 - 05:55 PM

Well... it posts to the correct page now, but I'm not getting any POST values, it's completely empty. No file is uploaded, and there are no POST values. I'm using the ASP.NET sample project from one of the other forum posts, and the applet downloaded from this post.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users