• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Tomcat

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the folloing warning

28-Jun-2016 16:09:36.482 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [PickByVoice] appears to have started a thread named [Java Sound Event Dispatcher] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.Object.wait(Object.java:502) com.sun.media.sound.EventDispatcher.dispatchEvents(EventDispatcher.java:182) com.sun.media.sound.EventDispatcher.run(EventDispatcher.java:222) java.lang.Thread.run(Thread.java:745)


I got a webservice and when a request is called the webservice will playback a sound file. It doesnt work.

It works in eclipse useing the tomcat Server plugin.

sourceDataLine.open(format); this is the one who creates the error  

hope someone can help me.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Dieter!

The log message indicates that the webapp is creating a Thread that it does not destroy. In addition to obstructing Tomcat's ability to terminate itself cleanly, it also indicates a possible bug (or at least careless programming) in the application. Please note that in any event no HttpServlet function may spawn a thread. Not only is it a violation of the J2EE standards, but it can potentially corrupt Tomcat itself.

I'm not sure how you intend to play a sound. If you literally code a sound-playing function in your webapp, the sound cannot be heard on the client machine, because the server will be playing it through whatever audio channels the server machine itself has available. And server machines are rarely hooked up to loudspeakers.

To get a server-generated sound to play on a client you would have to respond to the servlet request with an audio data stream. Specifically, it would have to be encoded with a MIME type for one of the media forms that the client machine can play.
 
dieter hansen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all thanks for the replay.

ok a short discription. i want to get a client to send a request. The Service gets the request and with the sended information, the service plays back audiofiles on the same machine as the service runs on.

I am using Javax.sound.sample.

probably i should mention that i am using jax-rs.

the thing is in eclipse with tomcat plugin its works fine. not errors and the sound is playing.

but when i want to run it on a tomcat server it displays the error. the service is still working as normal except the audio playback.

i can provide some code tomorrow if it helps

thanks
 
That feels good. Thanks. Here's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic