Wowza Community

Restart Wowza

Hey Everyone!

I am with a problem that when I restart the Wowza Server in Wowza Streaming Engine he doesn’t work more. Acessing http://[wowza-ip]:1935 the server isn’t found. Acessing Wowza Streaming Engine and trying to add stream the message is shown:

"MediaCaster type not found[live/definst]: rtp"

Can anyone tell me what can be? Would it be a bug?

Because i saw in Release Note [https://www.wowza.com/docs/wowza-streaming-engine-4-0-4-release-notes that this issue [“Fixed RTP MediaCaster thread locking issue with application instance shutdown”] was corrected.

P.S: Wowza Streaming Engine version 4.0.4 in AMI (Amazon Machine Images) with license Byol.

AMI ID: WowzaStreamingEngine-ebs-byol-4.0.4-x86_64-5f03c7f6-de9b-43fe-a602-1c49f77d1a02-ami-1e847d76.2 (ami-574ae54a)

Hello there,

Are you sure you restarted the stream upon Wowza restart? How are you starting the stream? /conf/StartupStreams.xml or from Stream Manager?

Salvadore

You can start a MediaCaster stream in a ServerListener, which runs when Wowza starts.

Something like this:

package test;
import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.logging.*;
import com.wowza.wms.mediacaster.IMediaCaster;
import com.wowza.wms.mediacaster.MediaCasterStreamItem;
import com.wowza.wms.mediacaster.MediaCasterStreamMap;
import com.wowza.wms.server.*;
import com.wowza.wms.vhost.IVHost;
import com.wowza.wms.vhost.VHost;
import com.wowza.wms.vhost.VHostSingleton;
public class ServerListenerMediaCasterExample implements IServerNotify2 {
	public void onServerInit(IServer server) {
		WMSLoggerFactory.getLogger(null).info("onServerInit");
		
		IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
		
		IApplicationInstance appInstance = vhost.getApplication("live").getAppInstance("_definst_");
		
		MediaCasterStreamMap mediaCasterMap = appInstance.getMediaCasterStreams();
		MediaCasterStreamItem mediaCasterItem = mediaCasterMap.acquire("mystream.stream", "rtp-live");
				
	}
		
	public void onServerConfigLoaded(IServer server) {
		WMSLoggerFactory.getLogger(null).info("onServerConfigLoaded");
	}
	public void onServerCreate(IServer server) {
		WMSLoggerFactory.getLogger(null).info("onServerCreate");
	}
	public void onServerShutdownStart(IServer server) {
		WMSLoggerFactory.getLogger(null).info("onServerShutdownStart");
	}
	public void onServerShutdownComplete(IServer server) {
		WMSLoggerFactory.getLogger(null).info("onServerShutdownComplete");
	}
}

Richard

HI,

Yes, correct. You need to configure StartupStreams, guide here, so that the streams are started automatically when the Wowza Streaming Engine is restarted.

Daren

Are you sure you restarted the stream upon Wowza restart? How are you starting the stream? /conf/StartupStreams.xml or from Stream Manager?

Lets see what the logs have to say, start Wowza in stand alone mode, [install-dir]/bin/startup.bat(startup.sh on Mac)

This will display the logs in the console. Do you see any start up errors in the logs?

Salvadore

In your run or debug configuration in eclipse, try adding the following to the VM Arguments on the Arguments tab.

-Dcom.wowza.wms.native.base="win"

Salvadore

Be sure your JAVA_HOME environment variable is pointing at the the correct version of Java. Try opening a DOS prompt and enter:

%JAVA_HOME%/bin/java -version

See what that returns. If incorrect version then update the JAVA_HOME environment variable to point to the correct location.

After installing latest Java version, java command is still using old Java (fix)

I hope this helps.

Salvadore

To update, it looks like the error you are getting suggests that you are running a newer version of java on the dev server then you are running on the production server.

You should use the same version (or older version) on the dev machine that is running on the production machine.

Salvadore

Excellent! Thanks for the update, glad you got this sorted out and happy to help!

Salvadore

Guilherme,

I am not sure what you mean, can you please explain exactly what you are doing when this happens, and exactly what is happening.

Thanks.

Salvadore

Hello Salvadore,

Yes, i have. Indeed i restart the Wowza service in Wowza Streaming Engine Interface and it stopped to work. I start the stream by Stream Manager too. When i try to access http://[wowza-ip]:1935 informations like “Wowza Streaming Engine 4 Developer Edition 4.0.4 build[numbers_here]” are not displayed.

INFO server comment - MediaCache[MediaCache]: Started

INFO server comment - REST API: ready

Error starting: java.lang.reflect.InvocationTargetException

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.wowza.wms.bootstrap.Bootstrap.startServer(Bootstrap.java:555)

at com.wowza.wms.bootstrap.Bootstrap.main(Bootstrap.java:67)

Caused by: java.lang.UnsupportedClassVersionError: com/ipset/wms/httpprovider/StreamingRequest : Unsupported major.minor version 52.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at com.wowza.wms.util.VHostUtils.loadHTTPProvider(VHostUtils.java:61)

at com.wowza.wms.util.VHostUtils.loadHostPort(VHostUtils.java:609)

at com.wowza.wms.util.VHostUtils.loadHostPortList(VHostUtils.java:686)

at com.wowza.wms.util.VHostUtils.loadConfigFile(VHostUtils.java:978)

at com.wowza.wms.vhost.VHost.c(VHost.java:1185)

at com.wowza.wms.vhost.VHost.init(VHost.java:501)

at com.wowza.wms.vhost.VHostSingleton.init(VHostSingleton.java:62)

at com.wowza.wms.server.Server.startVHost(Server.java:2215)

at com.wowza.wms.server.Server.startVHosts(Server.java:2764)

at com.wowza.wms.server.Server.start(Server.java:1006)

… 6 more

i see that the error happened in HTTPProvider created by me. But i create in a development environment with the same Wowza version. What would be a “Unsupported major.minor version 52.0”? Java version?

So Salvadore for to develop the HTTProvider i set this variable before. I saw in another thread here in the Forum.

In fact the problem was the java version. Wowza in the production server has java 1.7.0_55 while in development environment was 1.8.0. Thus I downloaded the jre e jdk for 1.7.0_55 version and build again the project. That’s worked.

Thank you very much for your help Salvadore.

Best Regards,

Guilherme.

You are Welcome!

I just have one more question Salvadore. When I restart the Wowza streams in the “Live Application” disappear. How do I prevent this from happening?

Then it happens when I restart the server in Wowza Streaming Engine Manager. All .streams in the live Application disappear. Do i need to configure StartupStreams file? How can I make a startup of a Application like live or vod?

Thank you too.

Guilherme.

Hey Daren. Thank you for reply.

Right! And there any method in the Wowza API that with the stream name publishes automatically the stream to come up with the server? Or maybe startup a VHost, Application or Application Instance automatically?

All right. I’ll try here.

Thank you Richard.

Best Regards,

Guilherme.