spring-data-geode and spring-boot-starter-webflux application run failed - spring-webflux

I have a webflux project and I am adding apache geode. In my build.gradle I have:
implementation 'org.springframework.data:spring-data-geode:2.2.4.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-webflux:2.2.4.RELEASE'
Once adding the spring-data-geode implementation the application crashes with:
2020-01-28T16:29:51,965 INFO [main] org.eclip.jetty.util.log.Log 169 initialized: Logging initialized #4337ms to org.eclipse.jetty.util.log.Slf4jLog
2020-01-28T16:29:52,050 WARN [main] org.sprin.conte.suppo.AbstractApplicationContext 558 refresh: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet/ServletHolder
2020-01-28T16:29:52,064 INFO [main] org.sprin.boot.autoc.loggi.ConditionEvaluationReportLoggingListener 136 logMessage:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-01-28T16:29:52,072 ERROR [main] org.sprin.boot.SpringApplication 826 reportFailure: Application run failed
org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet/ServletHolder
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:81)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
The trouble is, if I add
spring.main.web-application-type=none or spring.main.web-application-type=reactive to my application.properties then that interferes with the #ClientCacheApplication(name = "Web", locators = #Locator(host="1.2.3.4", port=10334), logLevel = "debug", subscriptionEnabled = true) annotation and the application does not connect to the geode locator, nor then run the #EnableClusterDefinedRegions which causes problems defining simple regions that I want to pick up from the server.
UPDATE To add spring-boot-starter-web to build.gradle and make the spring boot application type NONE as below appears to fix the instant problem, but...
SpringApplication app = new SpringApplication(Web.class);
app.setWebApplicationType(WebApplicationType.NONE);
SpringApplication.run(Web.class, args);
... but then the webflux mapping cannot find the #Bean websocket handler:
2020-01-28T16:54:26,236 DEBUG [http-nio-8082-exec-2] org.sprin.web.servl.handl.AbstractHandlerMapping 412 getHandler: Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
2020-01-28T16:54:26,246 DEBUG [http-nio-8082-exec-2] org.sprin.web.servl.resou.ResourceHttpRequestHandler 454 handleRequest: Resource not found
2020-01-28T16:54:26,246 DEBUG [http-nio-8082-exec-2] org.sprin.web.servl.FrameworkServlet 1131 logResult: Completed 404 NOT_FOUND
and this causes the website to error:
The console log says
WebSocket connection to 'ws://localhost:8082/ws/data' failed: Error during WebSocket handshake: Unexpected response code: 404

The problems with regions was because the classes using the regions defined by #EnableClusterDefinedRegions were (a) instantiated by new command rather than Spring #Autowired; and (b) in another package not seen by the Spring Boot #ComponentScan. Once these were fixed then the regions were auto-defined and handled using #Resource annotation.
#Resource(name = "Example") private Region<Object, Object> example
Also the main program was given
SpringApplication app = new SpringApplication(Web.class);
app.setWebApplicationType(WebApplicationType.REACTIVE);
SpringApplication.run(Web.class, args);
The other problem was fixed by getting the correct dependencies in the build.gradle and then annotating endpoints for rSocket / webSocket with:
#MessageMapping(value = "helloWorld")
public Flux<String> getFluxSocket() {
log.traceEntry();
log.info("In hello world");
return Flux.just("{\"Hello\":\"World\"}");
}
or
#GetMapping(value = "/helloWorld", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<String> getRestSocket() {
log.traceEntry();
return Flux.just("Hello World");
}
for HTTP endpoints.

Related

spring gateway unable to start with feign client

Using Spring 2.7.0 to create an API gateway, that was working fine until I tried to replace the RestTemplate with OpenFeign.
Here is the relevant build.gradle contents:
plugins {
id 'org.springframework.boot' version '2.7.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'org.liquibase.gradle' version '2.1.0'
id 'groovy'
}
ext {
set('springCloudVersion', "2021.0.3")
}
// implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
My application class:
#SpringBootApplication
#EnableDiscoveryClient
#EnableFeignClients
public class ApiGatewayApplication {
...
}
My FeignClient:
#FeignClient(name="identity-service")
public interface IdentityServiceClient {
#GetMapping("/api/all")
public List<ApiKey> getAllApiKeys();
}
when I try to start the application now I get:
o.s.c.openfeign.FeignClientFactoryBean : For 'identity-service' URL not provided. Will try picking an instance via load-balancing.
DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses RestTemplate
....
onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiGatewayApplication': Invocation of init method failed; nested exception is feign.codec.DecodeException: No qualifying bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
com.netflix.discovery.DiscoveryClient : Unregistering ...
com.netflix.discovery.DiscoveryClient : DiscoveryClient_API-GATEWAY/192.168.1.72:api-gateway:8081 - deregister status: 404
com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
***************************
APPLICATION FAILED TO START
***************************
Description:
A component required a bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters' in your configuration.
But none of the online examples seem to show the need for adding custom HttpMessageConverters since they are included in spring-web and spring-boot-starter-webflux
UPDATE -
this appears to be related to #Autowired. I put both my service and feign service in a regular class and it starts up fine. But when I autowire those two services, I get this error again.

javafx 16 WebEngine Exception "SSL Handshake failed"

I am porting an android app to javaFX for windows deployment, i'm new to javaFX and desktop deployment, but not so new to java.
The app contains a WebView that loads a url obtained from a server via Json (so could be essentially anything).
openJDK 14 , openJfx 16, intellij idea ultimate 2021.1.3, gradle: plugins: org.beryx.jlink & org.openjfx.javafxplugin
This works fine when I run the program in development and testing (on a windows 10 machine), but when it is packaged and deployed on a windows machine (any windows 10 so far) I get an "java.lang.Throwable: SSL handshake failed" exception when the page is loaded.
This is the stack trace:
[ERROR] 2021-07-14 14:13:53.737 [JavaFX Application Thread] MediaElementWeb - WebView Failed:
java.lang.Throwable: SSL handshake failed
at javafx.scene.web.WebEngine$LoadWorker.describeError(WebEngine.java:1440) ~[javafx.web:?]
at javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(WebEngine.java:1379) ~[javafx.web:?]
at javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(WebEngine.java:1240) ~[javafx.web:?]
at com.sun.webkit.WebPage.fireLoadEvent(WebPage.java:2524) ~[javafx.web:?]
at com.sun.webkit.WebPage.fwkFireLoadEvent(WebPage.java:2369) ~[javafx.web:?]
at com.sun.webkit.network.URLLoaderBase.twkDidFail(Native Method) ~[javafx.web:?]
at com.sun.webkit.network.URLLoader.notifyDidFail(URLLoader.java:799) ~[javafx.web:?]
at com.sun.webkit.network.URLLoader.lambda$didFail$6(URLLoader.java:782) ~[javafx.web:?]
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:447) ~[javafx.graphics:?]
at java.security.AccessController.doPrivileged(AccessController.java:391) ~[?:?]
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:446) ~[javafx.graphics:?]
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) ~[javafx.graphics:?]
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) ~[javafx.graphics:?]
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) ~[javafx.graphics:?]
at java.lang.Thread.run(Thread.java:832) [?:?]
The problem is not specific to any particular certificate, so I know it is not a problem specifically with the certificate generally, tested with many sites. and I ONLY get this error in the deployed app.
The page is being loaded in a standard way: WebEngine.load(targetURL);
I am capturing the error with:
tNode.getEngine().getLoadWorker().stateProperty().addListener((o, ov, nv) -> {
if (nv == Worker.State.FAILED) {
logger.error("WebView Failed: ", tNode.getEngine().getLoadWorker().getException());
}
});
I have searched and tried solutions offered by other people that seem to have experienced similar errors, such as:
Setting a trust manager before calling load(page):
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (GeneralSecurityException e) {
logger.error("SSLContext Failed: ", e);
}
(No errors or effect here)
and
settings the JVMarg on the deployment
-Dcom.sun.webkit.useHTTP2Loader=false
Which I can see has the effect of "com.sun.webkit.network.URLLoader" being shown in the stack trace instead of http2 (as was suggested on other threads) but also no change here either.
Has anyone any thoughts (bearing in mind I'm a novice at java desktop deployment) at what the issue can be and how to resolve it?
Many thanks
Update:
Trace from console on deployed test https://pastebin.com/R5SkR4w1
First few rows:
javax.net.ssl|WARNING|2C|URL-Loader-1|2021-07-15 10:46:45.991 BST|SignatureScheme.java:295|Signature algorithm, ed25519, is not supported by the underlying providers
javax.net.ssl|WARNING|2C|URL-Loader-1|2021-07-15 10:46:45.992 BST|SignatureScheme.java:295|Signature algorithm, ed448, is not supported by the underlying providers
javax.net.ssl|WARNING|2C|URL-Loader-1|2021-07-15 10:46:45.995 BST|NamedGroup.java:297|No AlgorithmParameters for x25519 (
"throwable" : {
java.security.NoSuchAlgorithmException: Algorithm x25519 not available
at java.base/javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:192)
at java.base/sun.security.ssl.NamedGroup.<init>(NamedGroup.java:286)
at java.base/sun.security.ssl.NamedGroup.<clinit>(NamedGroup.java:184)
at java.base/sun.security.ssl.SignatureScheme.<clinit>(SignatureScheme.java:59)
at java.base/sun.security.ssl.SSLSessionImpl.<clinit>(SSLSessionImpl.java:823)
at java.base/sun.security.ssl.TransportContext.<init>(TransportContext.java:133)
at java.base/sun.security.ssl.TransportContext.<init>(TransportContext.java:103)
at java.base/sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:111)
at java.base/sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:72)
at java.base/sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:413)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:162)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
at ...
Managed to solve this with helpful comments from #slaw about a suggestion I had tried initially, but ultimately not implemented correctly, and help from #dave_thompson_085 with how to provide extra debugging info. So the resolution, and a few tips for people in the same boat:
1. The solution:
The Badass Jlink Plugin for gradle on Intellij IDEA, for Java 14 and JavaFX 16 was not correctly merging the security provider classes.
This was resolved by adding "jdk.crypto.ec" to the merged modules list.
2. Adding the module manually
The org.beryx.jlink plugin (2.24.0) is really complex and powerful, so it was a struggle to work out how to do it with my implementation.
I tried many combinations, but the following code did it for me in my build.gradle:
jlink {
//... Other jlink \ jpackage stuff
mergedModule {
additive = true
requires 'jdk.crypto.ec'
}
//... Other jlink \ jpackage stuff
}
3. Debugging packaged java binary for windows
Some Jlink config changes that helped along the way.
jlink {
//..
jpackage {
//..
imageOptions = [
"--win-console"
]
}
//..
launcher {
jvmArgs = ['-Dcom.sun.webkit.useHTTP2Loader=false','-Djavax.net.debug=ssl:handshake']
}
}
--win-console opens a console window when you start your program so you can see the logging out put
-Djavax.net.debug=ssl:handshake gives more information about the SSL process and handshaking so you can see what is happening.

Error handler for MBassador message/event bus

I'm using MBassador 1.2.1 message/event bus. Works well. Except that I am getting this error message in my logs, repeated for each of my instantiated bus objects:
WARN: No error handler configured to handle exceptions during publication.
Error handlers can be added to any instance of AbstractPubSubSupport or via BusConfiguration.
Falling back to console logger.
The main project page shows this example line on a BusConfiguration object:
.addPublicationErrorHandler( new IPublicationErrorHandler{...} )
…yet neither my IDE nor I see any such method on the BusConfiguration class.
How should I go about installing an error handler for Mbassador?
Add it as another property when building the configuration bus:
IBusConfiguration config = new BusConfiguration()
.addFeature(Feature.SyncPubSub.Default())
.addFeature(Feature.AsynchronousHandlerInvocation.Default())
.addFeature(Feature.AsynchronousMessageDispatch.Default())
.setProperty(Properties.Common.Id, "Command Channel Bus")
.setProperty(Properties.Handler.PublicationError, new IPublicationErrorHandler() {
#Override
public void handleError(PublicationError error) {
}
});
I had the exact same issue as you and this solved my problem.

Cannot create a secure XMLInputFactory when calling Apache CXF Client from Plain Java

I am trying to call a Apache CXF Service from a Plain Java code as follows
public static void main(String args[])
{
Call Apache CXF Service ....
}
I dont get any compile time error, but getting Runtime exception as follows
Exception in thread "main" java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:314)
at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:264)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1457)
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1110)
at org.apache.cxf.bus.extension.XmlExtensionFragmentParser.getExtensions(XmlExtensionFragmentParser.java:46)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl.java:183)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl.java:159)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl.java:108)
at org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:121)
at org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:134)
at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:40)
at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:36)
at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:32)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:106)
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:243)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:227)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89)
at javax.xml.ws.Service.<init>(Unknown Source)
The dependencies I have are as follows
cxf-rt-frontend-jaxws-2.7.12.jar
cxf-api-2.7.12.jar
woodstox-core-asl-4.4.0.jar
stax2-api-3.1.4.jar
xmlschema-core-2.1.0.jar
cxf-rt-core-2.7.12.jar
jaxb-impl-2.1.13.jar
cxf-rt-bindings-soap-2.7.12.jar
cxf-rt-databinding-jaxb-2.7.12.jar
cxf-rt-bindings-xml-2.7.12.jar
cxf-rt-frontend-simple-2.7.12.jar
cxf-rt-ws-addr-2.7.12.jar
cxf-rt-ws-policy-2.7.12.jar
cxf-rt-transports-http-2.7.12.jar
Please help me solve this error
Note:- I don't have pom.xml. I use traditional "lib" folder to place my dependent jars
I added these three lines and worked fine
Properties props = System.getProperties();
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
props.setProperty("UseSunHttpHandler", "true");

Red5 Application fails to connect

I am attempting to run a basic application on Red5 that just makes an attempt to connect to the red5 server (on localhost). The source for this application is below:
import org.red5.server.adapter.ApplicationAdapter;
import org.red5.server.api.IConnection;
import org.red5.server.api.scope.IScope;
// import org.red5.server.api.service.ServiceUtils;
/**
* Sample application that uses the client manager.
*
* #author The Red5 Project (red5#osflash.org)
*/
public class Application extends ApplicationAdapter {
/** {#inheritDoc} */
#Override
public boolean connect(IConnection conn, IScope scope, Object[] params) {
return true;
}
/** {#inheritDoc} */
#Override
public void disconnect(IConnection conn, IScope scope) {
super.disconnect(conn, scope);
}
}
My client code is also pretty basic. For brevity, the snippet is below:
public function onCreationComplete(event:FlexEvent) : void {
// setup connection code
connection = new NetConnection();
connection.connect("rtmp://localhost/Player");
connection.addEventListener(NetStatusEvent.NET_STATUS, onConnectionNetStatus);
connection.client = this;
}
public function onConnectionNetStatus(event:NetStatusEvent) : void {
// did we successfully connect
if(event.info.code == "NetConnection.Connect.Success") {
Alert.show("Successful Connection", "Information");
} else {
Alert.show("Unsuccessful Connection "+event.info.code, "Information");
}
Note that I make the alert box show the error code so I can see what happens.
On the client side, when I attempt to connect, I get two failure messages:
Unsuccessful Connection NetConnection.Connect.Closed
Unsuccessful Connection NetConnection.Connect.Rejected
And on the server side I am seeing the following:
[INFO] [NioProcessor-10]
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Action connect
[INFO] [NioProcessor-10] org.red5.server.net.rtmp.RTMPConnection -
Setting object encoding to AMF3
[INFO] [NioProcessor-10] org.red5.server.net.rtmp.RTMPHandler - Scope
Player not found on localhost
[WARN] [Red5_Scheduler_Worker-3]
org.red5.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection
from 127.0.0.1 : 50051 to localhost (in: 3334 out 3256 ), with id 9
due to long handshake
It seems clear that something is wrong due to some kind of mis- configuration. Unfortunately, I have no idea where to look for the problem.
Could someone please give some idea of what is going wrong and how I can fix this? Thank you...
ADDITION: Startup Exception that occurs when running Red5 v1 RC2:
Exception in thread "Launcher:/Player" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with
name 'web.context' defined in ServletContext resource [/WEB-INF/red5-web.xml]:
Unsatisfied dependency expressed through bean property 'clientRegistry': : Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml];
nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1199)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1091)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:593)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:317)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:185)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:833)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1184)
... 11 more
Caused by: java.lang.ClassNotFoundException: org.red5.server.WebScope
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
... 19 more
Another Fact could be that u have 2 Red5.jars so u have to delete one. In my case it worked rly good.
Big Ty for this post
Change org.red5.server.WebScope to org.red5.server.scope.WebScope in your red5-web.xml file.
what version of Red5 is that?
Are there any exceptions when you startup your custom webapp? There might be already an error in the startup of the server that consequently leads to your issue.
Sebastian
The application scope that you are attempting to connect to "Player" does not exist on the server; the log notes this as "Scope Player not found on localhost". What this means in general is that your application didn't load. The reason that it didn't load looks like class package error for WebScope. Change the beans class attribute to org.red5.server.scope.WebScope and try again.