[JBoss Seam] - Seam Flex Integration, How Easy It Is!
by cingram
I have successfully integrated Seam and Flex, and it was really easy!
Through the Seam remoting interface I was able to create a wrapper and an Actionscript object to help with the communication. The Adobe AjaxFlex bridge makes the communication portion from actionscript to javascript fairly simple. By including a couple javascript files and one actionscript file you can be on your way. I thought I would include a simple example to show how easy it can be. One thing I find kind of interesting is that you can have a Flex UI and a Facelets UI in the same project, both using the same backend. The Seam guys did a really great Job on the remoting interface which is what makes this possible!
Here is an example of the Actionscript code.
|
| <fab:FABridge xmlns:fab="bridge.*" />
|
| private var seamBridge:SeamBridge = new SeamBridge();
|
| private function sayHello(): void {
| seamBridge.setSeamComponent("helloAction");
| seamBridge.setMethod("sayHello");
| seamBridge.addParam(txtName.text);
| seamBridge.setCallBackMethod("sayHelloCallBack");
| seamBridge.callServer();
| }
|
| public function getNameCallBack(result: String): void {
| Alert.show(?Hello ? + result + ? I am from Seam?;
| }
|
This is what you would use for your Seam code. Looks familiar doesn?t it? As a matter of fact it is from the Seam remoting example. This could easily be changed to a stateful bean and have it return a var or even an object.
| package org.jboss.seam.example.remoting;
|
| import javax.ejb.Stateless;
|
| import org.jboss.seam.annotations.Name;
|
| @Stateless
| @Name("helloAction")
| public class HelloAction implements HelloLocal {
| public String sayHello(String name) {
| return "Hello, " + name;
| }
| }
|
|
| package org.jboss.seam.example.remoting;
|
| import javax.ejb.Local;
| import org.jboss.seam.annotations.WebRemote;
|
| @Local
| public interface HelloLocal {
| @WebRemote
| public String sayHello(String name);
| }
|
|
The encapsulating html page must include the following references. Per the documentation, any object you want to expose via remoting must be referenced in the ?interface.js? line. The ?flexseam.js? file is just a wrapper file for the ?remote.js? to make the communication easier.
| <script src="FlexSeam.js" ></script>
| <script type="text/javascript" src="seam/resource/remoting/resource/remote.js"></script>
| <script type="text/javascript" src="seam/resource/remoting/interface.js?helloAction "></script>
|
We are in the process of putting a proof of concept together in Flex with a Seam backend. In this manner you have access to all of the contexts within Seam. If anyone feels this is usefull to their projects, please let me know and I will post the code files.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066237#4066237
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066237
18Â years, 9Â months
[Clustering/JBoss] - Not removing failed node from partition
by nsaunders
Hi All,
I'm having some problems configuring jgroups failure detection. I'm using jBoss JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339) and jgroups 2.2.9 beta2.
My setup consists of 2 nodes, each with 8 interfaces, paired into 4 redundant groups per node.
| |
| | App 1 | App 1
| | |
| ----------------- -----------------
| App 3 | | Mgmt | | App3
| ------| NODE 1 |---------------| NODE 2 |-------
| | | | |
| ----------------- -----------------
| | |
| | |
| | Database |
| ---------------------------------
I've used the -b option to bind all traffic to the management lan, and tweaked my application to bind only to the App 1 LAN. What I'm now trying to do is have the healthcheck/failure detection run explicitly over the Database LAN.
I've editted my cluster-service.xml file, which looks like this (editted for brevity):
<Config>
| <UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}" mcast_port="45566"
| ip_ttl="${jgroups.mcast.ip_ttl:8}" ip_mcast="true"
| mcast_recv_buf_size="2000000" mcast_send_buf_size="640000"
| ucast_recv_buf_size="2000000" ucast_send_buf_size="640000"
| loopback="false"/>
| <PING timeout="2000" num_initial_members="3"
| up_thread="true" down_thread="true"/>
| <MERGE2 min_interval="10000" max_interval="20000"/>
| <FD_SOCK srv_sock_bind_addr="192.168.104.56" down_thread="false" up_thread="false"/>
| <VERIFY_SUSPECT timeout="3000" num_msgs="3"
| up_thread="true" down_thread="true"/>
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800"
| max_xmit_size="8192"
| up_thread="true" down_thread="true"/>
| <UNICAST timeout="300,600,1200,2400,4800" down_thread="true"/>
| <pbcast.STABLE desired_avg_gossip="20000" max_bytes="400000"
| up_thread="true" down_thread="true"/>
| <FRAG frag_size="8192"
| down_thread="true" up_thread="true"/>
| <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
| shun="true" print_local_addr="true"/>
| <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
| </Config>
This is the config on Node 2 - 192.168.104.56 is this nodes VIP for the database interface.
I have removed the standard FD algorithm, as it was failing to detect a failure when the database connection was broken (Based on what I read here http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configu... - "Regular traffic from a node counts as if it is a live. So, the are-you-alive messages are only sent when there is no regular traffic to the node for sometime." - I assumed it must have seen other jGroups traffic across the management LAN and so counted it as alive).
The problem is that now the second node detects a failure correctly and sets itself to the master node, but getCurrentView() is still returning two nodes:
Fri Jul 20 14:34:17 BST 2007 MasterNode=true 192.168.105.158:1099 192.168.105.155:1099
(192.168.105.158 & 192.168.105.155 are the Management interfaces for Nodes 1 & 2 respecively)
What's interesting is when I plugged Node 1 back in, Node 2 breifly removed it from the partition before merging it back in:
Fri Jul 20 14:35:05 BST 2007 MasterNode=true 192.168.105.158:1099 192.168.105.155:1099
| Fri Jul 20 14:35:11 BST 2007 MasterNode=true 192.168.105.158:1099 192.168.105.155:1099
| Fri Jul 20 14:35:16 BST 2007 MasterNode=true 192.168.105.155:1099
| Fri Jul 20 14:35:22 BST 2007 MasterNode=true 192.168.105.155:1099 192.168.105.158:1099
| Fri Jul 20 14:35:29 BST 2007 MasterNode=true 192.168.105.155:1099 192.168.105.158:1099
Any advice or assistance would be greatly appreciated!
Kind Regards,
Neil Saunders.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066233#4066233
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066233
18Â years, 9Â months
[JBoss Seam] - s:fileUpload working locally but not remote
by tobias.hult
Hi,
I am using the s:fileUpload component in a webapp I am currently developing. When I run the webapp locally on my machine it works great. But when I deploy the app to our test server and try to upload a file the value-binding field is always null.
Does anyone know what the problem can be? I am running seam 1.2.1 and tomcat 5.5
Here's the code:
jspx page:
<s:fileUpload id="inUploadFile"
| data="#{fileUploadBean.uploadedFile}"
| fileName="#{fileUploadBean.fileName}"
| contentType="#{fileUploadBean.contentType}"
| styleClass="fileUploadInput" />
|
| <h:commandButton id="submitFileAndClose" value="Upload" action="#{fileUploadBean.uploadFile}" />
|
bean:
| private byte[] uploadedFile;
| public byte[] getUploadedFile()
| {
| log.debug("getUpFile called");
| return uploadedFile;
| }
| public void setUploadedFile(byte[] uploadedFile) {
| this.uploadedFile = uploadedFile;
| }
| public String uploadFile() throws IOException
| {
| if (null == uploadedFile || uploadedFile.length < 1) { //This is always the case on the remote machine
| log.error("No file to upload. Aborting...");
| facesMessages.add("No file chosen");
| return "";
| }
| ...
| ...
| ...
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066232#4066232
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066232
18Â years, 9Â months
[JBossWS] - trying to access a webservice - not working from either java
by rodgerca
Webservice has deployed fine on jboss 4.2
BUT
>From java client I get this at the ServiceFactory.createService() call
Starting Test Client
Creating a service Using:
http://127.0.0.1:8080/echo/EchoBean?wsdl
and {http://session.address.cmmgroup.com/}EchoService
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ws/addressing/AddressingProperties
at org.jboss.ws.core.jaxrpc.client.ServiceImpl.(ServiceImpl.java:107)
at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
at com.cmmgroup.address.client.EchoClient.main(EchoClient.java:23)
>From SOAPUI I get this (on the server, at least it is actually reaching the server!)
java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
I could send you my code but I pretty sure its ok - lifted straight from a web example. Also pretty sure my classpaths are ok - jboss-wsclient.jar, etc...
Please help, I've been trying to fix this for about two days....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066230#4066230
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066230
18Â years, 9Â months