BlazeDS can't change polling interval [duplicate] - java

Yesterday I spent half of day trying to force Flex Remoting to use HTTPS with no success.
Today I tried to connect to other domain.
I changed url of endpoint, but it looks like flex just ignores my changes.
I am sure that an old url doesn't exist in any file in src directory,
I even renamed services-config.xml to services-config2.xml, cleaned and rebuilded project many times, even made a release build, but it still connects to the same domain.
I have tested flex application in localhost and in the same domain, that has AMF services, but it works in the same way.
My services-config.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp">
<channels>
<channel ref="my-amfphp-secure"/>
<channel ref="my-amfphp"/>
</channels>
<properties>
<source>*</source>
</properties>
</destination>
</service>
</services>
<channels>
<channel-definition id="my-amfphp-secure" class="mx.messaging.channels.SecureAMFChannel">
<endpoint uri="https://xxx.dev.company.com:443/AMF" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<instantiate-types>false</instantiate-types>
<log-property-errors>true</log-property-errors>
</serialization>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel" >
<endpoint uri="http://xxx.dev.company.com/AMF" class="flex.messaging.endpoints.AMFEndpoint" />
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<instantiate-types>false</instantiate-types>
<log-property-errors>true</log-property-errors>
</serialization>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
</channels>
</services-config>
RemoteObject definition in mxml:
<mx:RemoteObject id="Agentrpc" destination="amfphp" source="Agentrpc" showBusyCursor="true">
<mx:method name="getAgentID" result="getAgentID_resultHandler(event)" fault="faultHandler(event)"/>
</mx:RemoteObject>
I'm using Flex 3.
Edit: I took a look at generated/ dir and I see that FlexInit files (like MainModule_FlexInit-generated.as) contains code:
ServerConfig.xml =
<services>
<service id="amfphp-flashremoting-service">
<destination id="amfphp">
<channels>
<channel ref="my-amfphp-secure"/>
<channel ref="my-amfphp"/>
</channels>
</destination>
</service>
<channels>
<channel id="my-amfphp-secure" type="mx.messaging.channels.SecureAMFChannel">
<endpoint uri="https://gintautas.dev.company.com:443/AMF"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel>
<channel id="my-amfphp" type="mx.messaging.channels.AMFChannel">
<endpoint uri="http://gintautas.dev.company.com/AMF"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel>
</channels>
</services>;
That's correct, but application doesn't make requests to gintautas.dev.company.com
Edit 2: I installed Flash Builder 4 and tried to compile using 3.5 and 4.0(in compatibility mode) compilers, but both has the same problem :(

Can you try to clear your browser cache ? The content of the services.xml is injected into the SWF at compile time.

you can check what is being compiled into flex from the *-config.XML files with the following:
trace( ServerConfig.XML );
Also, if using WTP with tomcat, check if server is using the actual installation of tomcat, or a temp eclipse folder to run. that can sometimes cause mix ups.

You must "clean project" in Flex Builder when you change services-config.xml

Related

Using application.properties in xml file

I am using spring boot application with appliaction.properties.
In the project there is XML file written by another company to configure Stomp, and there is hardcoded IP of the server, but I want to change those IP to take value from application.properties.
is there any way to do it?
application.properties
property.env=SLA
property.endpoint=http://172.1.1.139/router
tcmanager.xml
<tcmanager>
<channelbuilders>
<channelbuilder>
<class>com.company.tc.stomp.TcStompChannelBuilder</class>
<config>
<properties>
<property>brokerURL=[property.endpoint]</property> //this is the place
<property>login=login</property>
<property>passcode=pass</property>
</properties>
<in> [...] </in>
<out> [...]</out>
</config>
</channelbuilder>
</channelbuilders>
<processingbuilders>
<processingbuilder>
<class>com.company.tc.template.camel.MainProcessingBuilder</class>
<config>
<properties>
<property>p1=1</property>
</properties>
</config>
</processingbuilder>
</processingbuilders>
</tcmanager>

No Persistence provider for EntityManager named- when try to deploy from weblogic console

I'm struggling for a few days about this error.
When I try to deploy from ide(IntelliJ-eclipse), it works correct.
But when I try to deploy from WebLogic console, I got these errors;
Error Unable to access the selected application.
Error Unable to invoke Annotation processoror.
Error Unable to invoke Annotation processoror.
For more information, I checked logs and errors from stack trace.
It looks like the main error is: javax.persistence.PersistenceException: No Persistence provider for EntityManager named.
In debug, throwing from this code; Persistence.createEntityManagerFactory("persistanceUnitName");
Persistence classes are coming from javaee-web-abi-7.0.jar.
Everything looks fine in persistence.xml.
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="persistanceUnitName"
transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>dataSource</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database" value="Oracle" />
<property name="eclipselink.logging.parameters" value="true" />
<property name="eclipselink.logging.logger" value="DefaultLogger" />
<property name="eclipselink.logging.level" value="WARNING" />
<property name="eclipselink.refresh" value="true" />
<property name="eclipselink.query-results-cache" value="false" />
<!-- <property name="eclipselink.ddl-generation" value="create-or-extend-tables" />-->
</properties>
</persistence-unit>
</persistence>
persistance.xml located in /WEB-INF/classes/META-INF
We got a case like that: we have a test and prep environment. In test, it works, in prep doesn't work, in local doesn't work (from WebLogic console). Unfortunately, I can't see test server configs. But I expect the same options with prep. Anyway forget other environments, firstly I need to deploy successful from local.
Could you pls help me, I really don't know what I miss. Read every topic, tried everything
It looks like a classpath issue. Check your weblogic classpath.
If you are using eclipselink library must be loaded first when you are deploying.
Check this.
Add eclipselink into your project with scope provided:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.0</version>
<scope>provided<scope>
</dependency>
add same dependency into your weblogic classpath:
$WEBLOGIC_HOME/user_projects/domains/base_domain/lib
Then, add below to your weblogic.xml to use eclipselink library.
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.eclipse.persistence.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>

How to configure Amazon S3 as remote cache store for Hibernate Search 4.5.3

I have configured Hibernate Search to use infinispan and use File System based Cache Store to persist the indexes in file system instead of memory.
Now, I wish to configure S3 instead of File System, but I am not able to find the correct configuration for this.
My infinispan.xml file is:
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
xmlns="urn:infinispan:config:6.0">
<global>
<globalJmxStatistics enabled="false" />
<!-- <transport clusterName="storage-test-cluster" /> -->
<shutdown hookBehavior="DONT_REGISTER" />
</global>
<default>
<storeAsBinary
enabled="false" />
<locking
isolationLevel="READ_COMMITTED"
lockAcquisitionTimeout="20000"
writeSkewCheck="false"
concurrencyLevel="5000"
useLockStriping="false" />
<invocationBatching
enabled="false" />
</default>
<namedCache name="LuceneIndexesMetadata">
<persistence passivation="false">
<singleFile
fetchPersistentState="true"
preload="true"
purgeOnStartup="false"
shared="true"
ignoreModifications="false"
location="C:\\infinispan">
</singleFile>
</persistence>
</namedCache>
<namedCache name="LuceneIndexesData">
<persistence passivation="false">
<singleFile
fetchPersistentState="true"
preload="true"
purgeOnStartup="false"
shared="true"
ignoreModifications="false"
location="C:\\infinispan">
</singleFile>
</persistence>
</namedCache>
<namedCache name="LuceneIndexesLocking">
<!-- No CacheLoader configured here -->
</namedCache>
</infinispan>
Can anyone help me in configuring this file to use Amazon S3 as Cache Store.
The specific versions of Hibernate Search and Infinispan which you're using are extremely old. Specifically, Infinispan didn't support storage on Amazon S3 in version 6.
I would suggest upgrading to some more recent version which is still being maintained.
As of writing this, you could use Infinispan 9.1.5.Final with Hibernate Search 5.8.2.Final.

Issue in setting flex app in load balanced environment using SSL

I have developed the dashboard in my application using flex 3.0. For this I have used JSP wrapper around the flex application. My application runs on JBoss application server. for communication between flex app and my application i am using LCDS. HTTPService component is being used to receive data from the server. Channel definitions are given in service-config.xml for amf and http channels and for both secure secure and not secure mode. In my proxy-config.xml i have defined Channels and destinations.
services-config.xml
...
...
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
<channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>
<channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
...
...
proxy-config.xml
...
...
<default-channels>
<channel ref="my-http"/>
<channel ref="my-amf"/>
<channel ref="my-secure-http"/>
<channel ref="my-secure-amf"/>
</default-channels>
...
...
<destination id="dashboardService">
<properties>
<url>/kr/servlet/DashboardServlet</url>
</properties>
</destination>
<destination id="dashboardJSPService">
<properties>
<url>/kr/krportal/dashboardJSPService.jsf</url>
</properties>
</destination>
...
...
In my development environment both secure and non secure mode were working fine. Now when I have deployed it behind the load balancer(which accepts secure requests only and if the request is not secure it redirects it to secure url) there is no response from the message broker servlet. One thing more I have observed is when the environment is non load balanced there are request like 'http://{server.name}:{server.port}/{context.root}/messagebroker/http'. and these requests are post request. But in load balanced environment with ssl the request is again like 'http://{server.name}:{server.port}/{context.root}/messagebroker/http' which is a post request and it is redirected to 'https://{server.name}:{server.port}/{context.root}/messagebroker/http' which is a get request. The content returned by this get request is null.
Looking for some comments
Thanks
This config file is used by both flex and lcds. Flex uses it to send messages to a specific endpoint and lcds uses this file to actually create the endpoints. You'll notice the at the end of the urls you see /amf, /amfsecure, /http, and /httpsecure. If your load balancer is redirecting a call like http://domain.com/app/messagebroker/amf to https://domain.com/app/messagebroker/amf it will fail because the ssl endpoint ends with /amfsecure.

Problem Sending Server Side Messages from BlazeDS to All Browsers

I've run into a bit of a wall with sending messages from BlazeDS on the server to Flex clients. I have my adapters and destinations set properly (I think) messaging-config.xml and my streaming channel setup in my services-config.xml files. The messages work beautifully in Safari (Mac and PC) but no other browsers.
relevant Bits from messaging-config.xml
Adapter:
Destination:
<destination id="FriendNotifierGateway">
<adapter ref="friendNotifierAdapter" />
<properties>
<server>
<max-cache-size>1000</max-cache-size>
<durable>true</durable>
<allow-subtopics>true</allow-subtopics>
<subtopic-separator>.</subtopic-separator>
</server>
</properties>
<channels>
<channel ref="my-streaming-amf"/>
<channel ref="cf-polling-amf"/>
</channels>
Relevant Bits from services-config.xml
<channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint" />
<properties>
<idle-timeout-minutes>0</idle-timeout-minutes>
<max-streaming-clients>500</max-streaming-clients>
<server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
<user-agent-settings>
<user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="1" />
<user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="4" />
<user-agent match-on="Safari" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
<user-agent match-on="Opera" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
<user-agent match-on="Chrome" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
</user-agent-settings>
</properties>
I feel like things are setup correctly in the channel definition but, perhaps, some of those user-agent settings are off (I have played with their settings, to no avail thus far).
Thanks, in advance, for any suggestions or insights!
Regards,
Craig
I never sorted out why the server-side messages never reached the client. However, my setup was less than ideal for an active site. So, I switched to using ActiveMQ and, ever since, the messaging has been fantastic!

Categories

Resources