Red5. No scope with my project - scope

i can't create my application with Red5 server. I've got an error
NetConnection.Connect.Rejected: No scope 'TestEcho' on this server.
NetConnection.Connect.Closed
I did something like ping application to test that everything works fine. My class looks like this:
package org.red5.core;
import org.red5.server.adapter.ApplicationAdapter;
import org.red5.server.api.IConnection;
import org.red5.server.api.IScope;
import org.red5.server.api.service.ServiceUtils;
public class Application extends ApplicationAdapter {
public void appDisconnect(IConnection conn)
{
super.appDisconnect(conn);
}
public boolean appStart()
{
return true;
}
public void appStop()
{}
public boolean appConnect(IConnection conn, Object[] params)
{
return true;
}
public Object echo(Object p)
{
return p;
}
}
Also i have red5-web.xml and red5-web.properties
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--
Defines a properties file for dereferencing variables
-->
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/red5-web.properties" />
</bean>
<!--
Defines the web context
-->
<bean id="web.context" class="org.red5.server.Context"
autowire="byType" />
<!--
Defines the web scopes
-->
<bean id="web.scope" class="org.red5.server.WebScope"
init-method="register">
<property name="server" ref="red5.server" />
<property name="parent" ref="global.scope" />
<property name="context" ref="web.context" />
<property name="handler" ref="web.handler" />
<property name="contextPath" value="${webapp.contextPath}" />
<property name="virtualHosts" value="${webapp.virtualHosts}" />
</bean>
<!--
Defines the web handler which acts as an applications endpoint
-->
<bean id="web.handler"
class="org.red5.core.Application"
singleton="true" />
</beans>
And
webapp.contextPath=/TestEcho
webapp.virtualHosts=127.0.0.1
So, it's strange but in echo-demo application i can't get connection to rtmp://localhost:1935/TestEcho
And i'd like to notice that demo applications work good, for example, oflaDemo. Where is the problem?....

which version do you use?
if you use red5 1.0, please use
<bean id="web.scope" class="org.red5.server.scope.WebScope" init-method="register">
instead of
<bean id="web.scope" class="org.red5.server.WebScope" init-method="register">

Check the below things
check your folder name with in webapp folder. It should be "TestEcho"
check webAppRootKey in your web.xml file
enable debug in logback.xml in red5 conf folder. check your log while starting.
Ref: https://github.com/arulrajnet/red5Demo/wiki/Different-context-name

I am a bigginer in Red5. I have also Struggled with the same problem. After searching Plenty of forums I have figured it out. In my searching process I have gone through your query also. So I thought it would be helpful if I post solution here.
The problem is with having duplicate red5.jar file. In my scenario I have one jar file in my RED5_HOME and the other in myapp/WEB-INF/lib folder. We should not have two Red5.jar files. red5.jar must be in RED5_HOME directory. So I have removed all the jars including red5.jar from myapp/WEB-INF/lib folder. It Solved my issue.

I just had the very same issue, it was configuration issue with the virtualHost name.
I fixed by changing red5-web.properties from webapp.virtualHosts=localhost to webapp.virtualHosts=*.
Hope it helps

Check something very simple - if you are on Windows - red5 installs and starts a services by default. Then you might have manually copied another version of red5 - which you use for development. That is what happened with me - there was a Windows Service - running red5 - long forgotten. Whereas I was actually running another version of red5 form my filesystem.

Related

How to configure an attribute to be edited with a RichTextBox editor in SmartEdit?

I noticed that CMSParagraphComponent's content attribute can be edited using a RichTextBox like depicted in below image:
I want to edit my custom attribute in the same way(with the depicted RichTextBox). How can I do that ?
I tried configuring the backoffice-config.xml to use the wysiwyg:
<context merge-by="type" type="MyType" component="editor-area" module="moduleBackoffice">
<editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
<editorArea:tab merge-mode="replace" name="hmc.properties">
<editorArea:section name="hmc.properties">
<editorArea:attribute
editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.wysiwyg)"
qualifier="customStringAttribute"/>
</editorArea:section>
</editorArea:tab>
</editorArea:editorArea>
</context>
But this only reflects in backoffice and has no effect on SmartEdit.
How can I use the RichTextBox in smartEdit ?
Hybris version: 6.7.0.3
This can be resolved by creating below Spring bean:
<bean class="de.hybris.platform.cmsfacades.types.service.impl.DefaultComponentTypeAttributeStructure" p:typecode="MyType" p:qualifier="customStringAttribute">
<property name="populators">
<set>
<ref bean="richTextComponentTypeAttributePopulator" />
<ref bean="requiredComponentTypeAttributePopulator" />
</set>
</property>
</bean>
I added above defined bean in my ${extensionname}-spring.xml, restarted the server and everything worked as expected. The MyType's customStringAttribute is now configurable from smartedit in the exact same way as CMSParagraphComponent's content is.

inbound-channel-adapter cannot ignore "directory" tag element when using custom scanner

I use spring integration 4.2.6.RELEASE and try to create custom file watcher
something like this:
<int-file:inbound-channel-adapter id="filesInAdapter" directory="#{pojoUtil.sourceRootDir}" auto-create-directory="true"
channel="filesInChannel" scanner="watchDirectoryScanner" auto-startup="true">
<int:poller ref="globalPoller"/>
</int-file:inbound-channel-adapter>
<!-- directory scanner org.springframework.integration.file.WatchServiceDirectoryScanner -->
<!--id.lsa.scb.spring.integration.scanner.CustomScanner-->
<bean id="nioLocker" class="org.springframework.integration.file.locking.NioFileLocker"/>
<bean id="watchDirectoryScanner" class="id.lsa.scb.spring.integration.scanner.AdrFileScanner">
<constructor-arg value="#{pojoUtil.sourceRootDir}"/>
<property name="autoStartup" value="true"/>
<property name="filter" ref="compositeFilter"/>
<property name="locker" ref="nioLocker"/>
<property name="adrUtil" ref="pojoUtil"/>
</bean>
How to ignore directory tag element in int-file:inbound-channel-adapter? Because I thought we don't need that if the directory initiated in custom the file scanner. I have customize the file scanner so it can registering a list of directory into file watcher without need to watch the root of that list.
This has been resolved in 4.3 which should be released in the next week or so. It's available in the release candidate.
For now, you need to specify the directory in both places.

Cannot find cache named

I'm trying to use gemfire in my app to do caching. Here's my properties:
<context:component-scan base-package="my-base-package"/>
<context:annotation-config/>
<!-- Gemfire transation manager -->
<gfe:transaction-manager id="transactionManager" cache-ref="propertyGemfireCache"/>
<!-- Gemfire properties -->
<util:properties id="gemfire-props"
location="classpath:conf/environments/gemfire.properties"/>
<!-- Gemfire Client cache -->
<gfe:client-cache id="propertyGemfireCache" properties-ref="gemfire-props"
pool-name="gemfire-pool" pdx-serializer-ref="pdxSerializer" pdx-persistent="true"/>
<!-- Gemfire PDX serializer -->
<bean id="pdxSerializer" class="com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer">
<property name="serializableClasses">
<list>
<value>com\.acmecorp\.enterprise\.property\..*,java\.util\..*</value>
</list>
</property>
</bean>
<!-- Gemfire connection pool -->
<bean id="gemfire-pool" class="org.springframework.data.gemfire.client.PoolFactoryBean">
<property name="subscriptionEnabled" value="true"/>
<property name="freeConnectionTimeout" value="60000"/>
<property name="prSingleHopEnabled" value="true"/>
<property name="locators" ref="gemfireLocators"/>
</bean>
<bean id="gemfireCacheManager" class="org.springframework.data.gemfire.support.GemfireCacheManager"
p:cache-ref="propertyGemfireCache"/>
<gfe:client-region id="myRegion" name="${cache.region.name}" statistics="true"
cache-ref="propertyGemfireCache" shortcut="LOCAL">
<gfe:region-ttl timeout="86400"/>
</gfe:client-region>
<bean id="myTemplate" class="org.springframework.data.gemfire.GemfireTemplate">
<property name="region" ref="myRegion"/>
</bean>
<cache:advice id="myAdvice" cache-manager="gemfireCacheManager">
<cache:caching>
<cache:cacheable cache="myRegion" method="getSomeData"
key="''+#data"/>
</cache:caching>
</cache:advice>
<aop:config>
<aop:advisor advice-ref="myAdvice"
pointcut="execution( * *..ServiceImpl.getData(..)) and within(another-my-package.service.impl..*)"/>
</aop:config>
Property cache.region.name is equal to correct_region_name.
If I run my app i will get an error like:
Cannot find cache named 'myRegion' for CacheableOperation[] caches=[myRegion]
But if I replace "myRegion" with the correct region, which is correct_region_name. So it would look like this:
<cache:cacheable cache="correct_region_name" method="getSomeData"
key="''+#data"/>
Everything will work perfectly, but i don't need that. Any Help?
Spring (Data GemFire) looks up the Cache "name" in Spring's Cache Abstraction by the name of the Region (a.k.a. Cache; which is not necessarily the bean ID, which is set here, since the RegionLookupFactoryBean implements BeanNameAware).
You might try...
<cache:cacheable cache="${gemfire.region.name}" method="getSomeData" key="''+#data"/>
I think there may be an issue with using the property place holder ${cache.region.name} in the client-cache config and the order in which Spring resolves these things. Does it work if you hard code the region name there?

Why can't Azure find IISConfigurator.exe in my cspkg?

I am using the Azure 2.5 SDK to upload a cspkg + cscfg to create a new web role deployment in Azure. When I do, I see the following error with status BadRequest.
{"BadRequest : The file provided is not a valid service package. Detailed error code: {0} Invalid application runtime - a runtime component is missing:/base/x64/IISConfigurator.exe."}
Where {0} is the role/project name.
However, when I inspect the contents of my cspkg file, the base/x64 directory DOES contain IISConfigurator.exe.
I also notice that the RoleModel.xml file has been modified by packaging to contain an IISConfigurator.exe task as follows:
<RoleModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CacheExtension" version="2.5.6496.10" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<Startup>
<Task commandLine="IISConfigurator.exe" executionContext="elevated" relativePath="base\x64">
<Environment>
<Variable name="_IISCONFIGURATOR_SETUP_URL_REWRITE_" value="true" />
<Variable name="_IISCONFIGURATOR_CLEAN_SERVER_ONSTARTUP_" value="true" />
<Variable name="RdModuleName" value="IISConfigurator" />
</Environment>
</Task>
So my question is: What is the real cause of this error message?
Additional possible clues:
My RoleModel.xml in the cspkg also contains:
<Property name="TargetFrameworkVersion" value="v4.5.1" />
<Property name="RoleType" value="Web" />
<Property name="Configuration" value="Debug" />
<Property name="Platform" value="AnyCPU" />
<Property name="SetConfiguration" value="Configuration=Debug" />
<Property name="SetPlatform" value="Platform=AnyCPU" />
<Property name="RoleTargetFramework" value="v4.5.1" />
<Property name="TargetRuntimeVersion" value="v4.0" />
Tim, we have seen this issue only twice, and it was with developers who had upgraded to SDK 2.5.1. We were never able to reproduce the problem and we didn't find the root cause before those developers uninstalled the Azure SDK and reinstalled SDK 2.5 which caused the issue to go away.
Can you try uninstalling and reinstalling the Azure SDK? You could also try SDK 2.6 which was just released.
I had this issue using the Azure 2.9 SDK.
I started looking in control panel and was seeing what appeared to be some double installs.
I uninstalled all 2.9 Azure components from my PC, and reinstalled the required ones. Then it all worked for me.

Deploying Custom theme in production server

I'm working on a Liferay project.
I'm developing a new Liferay theme using Plugins SDK.
I wonder is it better to use ANT or MAVEN for the project?
Because I managed to run both projects in eclipse.
Also is there any way to deploy automatically the theme in the production server ? (Distant server using tomcat).
For now I'm just using auto deployment, copying the war file to the /deploy file.
Regards
You can add remote server to your Eclipse with Plugins SDK, check https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/developing-apps-with-liferay-ide-liferay-portal-6-2-dev-guide-02-en
(this may be helpful for older versions of plugins-sdk)
Assuming that you have ssh access to the remote server, the following ant target can be added and used in /liferay-plugins-sdk/build-common-plugin.xml
<property name="web-server" value="11.11.11.11" />
<property name="web-server-username" value="yourusername" />
<property name="web-server-password" value="yourpassword" />
<property name="web-server-deploy-folder-path" value="/liferay-x.x/deploy" />
<target name="remote-deploy" depends="war">
<echo message="Copying plugin to remote server ..." />
<scp
file="${plugin.file}"
todir="${web-server-username}:${web-server-password}#${web-server}:${web-server-deploy-folder-path}"
trust="true"
/>
<echo message="Done!" />
</target>

Resources