[EJB3] - classloading and remote access in ejb3
by Jure Lodrant
Jure Lodrant [http://community.jboss.org/people/lodrantj] created the discussion
"classloading and remote access in ejb3"
To view the discussion, visit: http://community.jboss.org/message/570450#570450
--------------------------------------------------------------
Hi guys
I love the dynamic classloading features of Java but it seems sometimes love is not enough, I'm lacking knowledge about it. Here it goes:
I'm using JBPM 3.2 in my EJB3 / web based app. JBPM is hidden in EJB3 layer. Now, I'd like to make a clear separation between everything process related on one side and the web part on the other. So I figured I'd just add some GUI content generating classes into the jbpm par archive, dynamically load them through a par classloader and simply send them as Class objects to the client. That was the theory.
So far, of course, it doesn't work. I simple get an exception on Class.newInstance call on the client.
On the second ran, I tried to call Class.newInstance inside the EJB and return the Object to the client as an implementation of a known interface. All I got was ClassNotFoundExceptions.
Now, before I dig any further, the question: Do I have I shot here, or am I just plain lurking in the impossible land?
It's basically down to this: Can a remote EJB expose a method returning an interface, of which the implementing class is dynamically evaluated and - this is vital - is not present on the client?
Please, advise!
Thank you..
Jure
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/570450#570450]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[JBoss Tools] - JBoss Tools 3.2.0 - ESB 4.9 - Helios - questions / problems
by Thorsten Heller
Thorsten Heller [http://community.jboss.org/people/thorsten_heller] created the discussion
"JBoss Tools 3.2.0 - ESB 4.9 - Helios - questions / problems"
To view the discussion, visit: http://community.jboss.org/message/573248#573248
--------------------------------------------------------------
I'm testing jBoss Tools 3.2.0 on Eclipse Helios (Mac OS X Snow Leopard) with jBossESB 4.9.
i got 2 questions / problems:
*1. using jBossTools with jBossESB-server-4.9:*
I created a server runtime envirnment pointing to my jBossESB-server-4.9 directory.
I created in the jboss tools tab a ESB runtime pointing to my jBossESB-server-4.9 directory, too.
I create a new ESB project with target runtime my previously genereted jbossesb-server-4.9 and ESB version 4.9.
I install ESB facet with Server supplied ESB runtime and ESB config version 1.3.
I create a new server in my server window selecting my esb server runtime. when I try to add my newly generated project as a resource to my new server environment, it tells me "The server does not support version 4.9 of the JBoss ESB Module specification." menaing I'm not able to deploy anything on my server.
shortly: my project is configured for ESB 4.9, all libraries are from my esb 4.9 directory. my server is pointing the my esb 4.9 server directory. but during the add / remove ressoures the server won't accept my project.
Any hints ? what did i miss?
*2. using jBossTools with jBossESB 4.9 deployed on a jBossAS 5.1*
I installed jBoss AS 5.1 and jBossESB 4.9 as described in the documentation. I tested my installation with the examples and it works.
Now I'm doing the same steps as descrive above, but of course everything pointing to my jBoss AS directory where I installed the ESB libraries.
In this case my new project is accepted as a deployable ressource on the server. in the server window my project appears under my server with status synchronized. I do some changes. add new services. new channels. services. i'm synchronizing and publishing my project, but it never appears on the server.
Any hints ? did I again miss something?
thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/573248#573248]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[Beginner's Corner] - twiddle localhost jboss 6.0
by David Bettenhausen
David Bettenhausen [http://community.jboss.org/people/dbhausen] created the discussion
"twiddle localhost jboss 6.0"
To view the discussion, visit: http://community.jboss.org/message/573200#573200
--------------------------------------------------------------
/var/jboss6/bin/twiddle.sh get "jboss.system:type=ServerInfo"
I have an ant script that deploys my ear from eclipse to my remote server. This script works when I have jboss 5 running and fails when I have jboss 6 (jboss-6.0.0.20101110-CR1) running. The only change I make to the script is to change the jboss home directory.
/var/jboss6/bin/twiddle.sh -q *-s localhost* invoke "jboss.system:service=MainDeployer" deploy "file:///home/websrc/ThirdEAR.ear"
I execute this with an ant but I also tried it from the command line. Works fine with 5.1 but with 6.0 it fails with
[sshexec] 11:37:47,800 ERROR [Twiddle] Exec failed
[sshexec] org.jboss.util.NestedRuntimeException: Service URL must start with service:jmx:; - nested throwable: (java.net.MalformedURLException: Service URL must start with service:jmx:)
[sshexec] at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:208)
[sshexec] at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:64)
[sshexec] at org.jboss.console.twiddle.command.MBeanServerCommand.queryMBeans(MBeanServerCommand.java:71)
[sshexec] at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:284)
[sshexec] at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:357)
[sshexec] Caused by: java.net.MalformedURLException: Service URL must start with service:jmx:
[sshexec] at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:143)
[sshexec] at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:308)
[sshexec] at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:318)
[sshexec] at org.jboss.console.twiddle.Twiddle.access$400(Twiddle.java:60)
[sshexec] at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:204)
[sshexec] ... 4 more
As a test I tried this simpler command on both 5.1 and 6.0
Either of these two command work when I have jboss 5.1 started.
/var/jboss5/bin/twiddle.sh get "jboss.system:type=ServerInfo"
/var/jboss5/bin/twiddle.sh *-s localhost* get "jboss.system:type=ServerInfo"
This command works when jboss 6 is started:
/var/jboss6/bin/twiddle.sh get "jboss.system:type=ServerInfo"
But this one with the *-s localhost* option:
/var/jboss6/bin/twiddle.sh -*s localhost* get "jboss.system:type=ServerInfo"
fails with:
11:27:58,215 ERROR [Twiddle] Exec failed
org.jboss.util.NestedRuntimeException: Service URL must start with service:jmx:; - nested throwable: (java.net.MalformedURLException: Service URL must start with service:jmx:)
at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:208)
at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:64)
at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:149)
at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:357)
Caused by: java.net.MalformedURLException: Service URL must start with service:jmx:
at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:143)
at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:308)
at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:318)
at org.jboss.console.twiddle.Twiddle.access$400(Twiddle.java:60)
at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:204)
... 3 more
Obviously this is not a bug but something I am not understanding. If one of you could toss me a clue that would be great. Hope you had a nice Thanksgiving. Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/573200#573200]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[JBoss Web Services] - Maven wsconsume fails
by Søren Poulsen
Søren Poulsen [http://community.jboss.org/people/meselfe] created the discussion
"Maven wsconsume fails"
To view the discussion, visit: http://community.jboss.org/message/573165#573165
--------------------------------------------------------------
Im trying to use the wsconsume maven plugin on the helloworld wsdl from the http://docs.jboss.org/tools/3.1.0.GA/en/ws_ref_guide/html/index.html Jboss ws user guide. Maven throws "org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xjc:globalJavaType' to a(n) 'group' component".
This is the full stacktrace:
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xjc:globalJavaType' to a(n) 'group' component.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.AssertionError: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xjc:globalJavaType' to a(n) 'group' component.
at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:78)
at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:233)
at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:522)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:232)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:134)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2244)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:187)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:133)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:182)
at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:230)
at org.jboss.wsf.spi.tools.WSContractConsumer.consume(WSContractConsumer.java:202)
at org.jboss.ws.plugins.tools.AbstractWsConsumeMojo.execute(AbstractWsConsumeMojo.java:123)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xjc:globalJavaType' to a(n) 'group' component.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDGroupTraverser.traverseLocal(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDAbstractParticleTraverser.traverseSeqChoice(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDAbstractParticleTraverser.traverseChoice(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDComplexTypeTraverser.processComplexContent(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDComplexTypeTraverser.traverseLocal(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseNamedElement(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseGlobal(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseSchemas(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:594)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:626)
at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:75)
... 31 more
This is the WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name='HelloWorldService' targetNamespace='http://webservices.samples.jboss.org/'
xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://webservices.samples.jboss.org/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<xs:schema targetNamespace='http://webservices.samples.jboss.org/'
version='1.0' xmlns:tns='http://webservices.samples.jboss.org/'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='sayHello' type='tns:sayHello' />
<xs:element name='sayHelloResponse' type='tns:sayHelloResponse' />
<xs:complexType name='sayHello'>
<xs:sequence>
<xs:element minOccurs='0' name='arg0' type='xs:string' />
</xs:sequence>
</xs:complexType>
<xs:complexType name='sayHelloResponse'>
<xs:sequence>
<xs:element minOccurs='0' name='return' type='xs:string' />
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name='HelloWorld_sayHello'>
<part element='tns:sayHello' name='sayHello'></part>
</message>
<message name='HelloWorld_sayHelloResponse'>
<part element='tns:sayHelloResponse' name='sayHelloResponse'></part>
</message>
<portType name='HelloWorld'>
<operation name='sayHello' parameterOrder='sayHello'>
<input message='tns:HelloWorld_sayHello'></input>
<output message='tns:HelloWorld_sayHelloResponse'></output>
</operation>
</portType>
<binding name='HelloWorldBinding' type='tns:HelloWorld'>
<soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http' />
<operation name='sayHello'>
<soap:operation soapAction='' />
<input>
<soap:body use='literal' />
</input>
<output>
<soap:body use='literal' />
</output>
</operation>
</binding>
<service name='HelloWorldService'>
<port binding='tns:HelloWorldBinding' name='HelloWorldPort'>
<soap:address location='http://127.0.0.1:8080/ws/HelloWorld' />
</port>
</service>
</definitions>
And this is the pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xyz</groupId>
<artifactId>ws</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ws Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-core</artifactId>
<version>3.1.2.GA</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>ws</finalName>
<plugins>
<plugin>
<groupId>org.jboss.ws.plugins</groupId>
<artifactId>maven-jaxws-tools-plugin</artifactId>
<version>1.0.0.GA</version>
<configuration>
<wsdls>
<wsdl>${basedir}/src/main/resources/hello.wsdl</wsdl>
</wsdls>
<targetPackage>foo.bar</targetPackage>
<extension>true</extension>
</configuration>
<executions>
<execution>
<goals>
<goal>wsconsume</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
Any1 who can help me out?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/573165#573165]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[Beginner's Corner] - Error in jboss
by Sérgio Costeira
Sérgio Costeira [http://community.jboss.org/people/scosteira] created the discussion
"Error in jboss"
To view the discussion, visit: http://community.jboss.org/message/573138#573138
--------------------------------------------------------------
Hi i just start use jboss and i can´t understand this error of log
2010-11-25 17:49:18,846 ERROR [org.apache.myfaces.util.LocaleUtils] Locale name null or empty, ignoring
2010-11-25 17:50:06,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:06,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:06,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:07,324 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:07,324 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:07,324 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:08,605 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:08,605 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:08,605 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:09,933 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:09,933 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:09,933 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:13,074 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:13,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:13,105 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:14,465 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:14,465 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:14,465 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:14,465 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:14,465 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:14,465 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:14,527 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:20,652 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:20,652 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:20,652 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:22,199 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:22,199 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:22,199 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:25,980 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:25,980 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:25,980 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:26,262 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:28,058 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:28,058 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:28,058 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:29,574 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:29,590 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:29,590 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:31,668 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:31,668 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:31,668 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:35,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:35,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:35,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:38,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:38,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:38,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:38,215 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:38,215 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:38,215 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:39,480 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:39,480 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:39,480 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:43,887 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:43,887 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:43,887 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:47,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:47,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:47,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:47,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:47,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,543 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,543 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,543 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,543 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,543 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [none] will be ignored
2010-11-25 17:50:48,949 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:48,949 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:48,949 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:49,230 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:49,230 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:49,230 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:49,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:49,965 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:50,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:50,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:50,449 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:52,480 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:52,652 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:52,652 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:53,605 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:53,605 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:53,605 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:56,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:56,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:56,183 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:50:57,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:50:57,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:50:57,090 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:51:01,590 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [write] will be ignored
2010-11-25 17:51:01,590 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [read] will be ignored
2010-11-25 17:51:01,590 WARN [org.jboss.portal.core.security.PortalObjectPermission] Unknown action in string [create] will be ignored
2010-11-25 17:51:02,137 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.PreferencesImpl]; using defaults.
2010-11-25 17:51:06,402 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.PreferenceImpl]; using defaults.
2010-11-25 17:51:06,418 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.UserImpl]; using defaults.
2010-11-25 17:51:06,668 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.role.RoleImpl]; using defaults.
2010-11-25 17:51:06,699 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.PreferencesGroupImpl]; using defaults.
2010-11-25 17:51:06,699 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.role.RoleImpl.users]; using defaults.
2010-11-25 17:51:06,715 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.UserImpl.roles]; using defaults.
2010-11-25 17:51:06,715 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.PreferenceImpl.strings]; using defaults.
2010-11-25 17:51:06,715 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.PreferencesGroupImpl.prefMap]; using defaults.
2010-11-25 17:51:06,715 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.PreferencesImpl.content]; using defaults.
2010-11-25 17:51:06,715 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.user.UserImpl.dynamic]; using defaults.
2010-11-25 17:51:06,762 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
2010-11-25 17:51:06,762 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
2010-11-25 17:51:08,199 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.instance.InstanceImpl]; using defaults.
2010-11-25 17:51:08,433 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.instance.PreferenceImpl]; using defaults.
2010-11-25 17:51:08,449 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.instance.InstanceImpl.preferencesMap]; using defaults.
2010-11-25 17:51:08,449 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.instance.PreferenceImpl.strings]; using defaults.
2010-11-25 17:51:08,465 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
2010-11-25 17:51:08,465 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
2010-11-25 17:51:09,168 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.portal.PortalObjectImpl]; using defaults.
2010-11-25 17:51:09,199 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.portal.ObjectNode]; using defaults.
2010-11-25 17:51:09,418 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.portal.ObjectNode.children]; using defaults.
2010-11-25 17:51:09,418 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.portal.PortalImpl.windowStates]; using defaults.
2010-11-25 17:51:09,418 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.portal.PortalObjectImpl.declaredProperties]; using defaults.
2010-11-25 17:51:09,418 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.jboss.portal.core.impl.model.portal.PortalImpl.modes]; using defaults.
2010-11-25 17:51:09,433 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
2010-11-25 17:51:09,433 WARN [org.hibernate.cache.EhCacheProvider] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
2010-11-25 17:51:15,121 ERROR [org.apache.myfaces.util.LocaleUtils] Locale name null or empty, ignoring
2010-11-25 17:52:46,980 WARN [org.jboss.deployment.MainDeployer] undeploy 'file:/C:/portal/jboss/server/portal/deploy/jbossweb-tomcat55.sar/ROOT.war/WEB-INF/' : package not deployed
2010-11-25 17:52:46,980 WARN [org.jboss.deployment.MainDeployer] undeploy 'file:/C:/portal/jboss/server/portal/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/WEB-INF/' : package not deployed
Someone can help with this problem.Thanks
SC
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/573138#573138]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[JBoss Tools] - Eclipse wizards with jface databinding in Deltacloud Tools (1)
by Andre Dietisheim
Andre Dietisheim [http://community.jboss.org/people/adietish] modified the document:
"Eclipse wizards with jface databinding in Deltacloud Tools (1)"
To view the document, visit: http://community.jboss.org/docs/DOC-15964
--------------------------------------------------------------
h1. Less code
If you use jface databinding to code your swt views in Eclipse you'll get spared from writing listeners and updating code by hand. JFace databinding offers very nice abstractions and automatisms that offer funcitonalities for the vast majority of the tasks where you have to listen for user input and update a view accordingly.
h1. Premise
If you implement a complex and highly dynamic UI in Eclipse you'll have to code many listener that wait for user actions. Those listeners mostly do nothing spectacular but update widgets and models in reaction to user inputs. You end up with a lot of repetitive boilerplate code. UI frameworks in the non-java land (ex. http://qt.nokia.com/products/ Trolltechs QT) always had approaches that were far more elegant than what we usually did in Swing and SWT.
Fortunately those so called binding approaches made it into http://jgoodies.com/ Swing and http://wiki.eclipse.org/index.php/JFace_Data_Binding Eclipse. Eclipse offers nowadays a very mature (developed since 2006) framework that spares you from boilerplate and leads to far more concise and a less verbose implementations: Jface Databinding!
h1. Usecase
In Deltacloud tools, we had to implement a wizard page that allows a user to create a connection to a Deltacloud server:
The user has to supply a name, an url and the credentials for it.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-106... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
Sounds pretty simple at first sight. Looking closer at it you'll discover few buttons and labels, that shall get updated upon user inputs. We need to inform the user in a intuitive way and mark form fields by error decorations. The wizard page shall also show a global error message that reflects the errors in a human readable manner.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-106... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
h1.
We choose to use jface databinding and not to stick to the traditional, tedious approach. I'll discuss our implementation in a simplified way. You may have a look at the complete implementation at http://anonsvn.jboss.org/repos/jbosstools/trunk/deltacloud/plugins/org.jb... CloudConnectionPage.java
h1.
h1. Let us get to the (little) code
h2. The user must provide a name for the connection
We stick to a fairly simple use case and discuss all steps that we have to take: The user musn't leave the name blank, he has to name the connection.
The picture above shows the various ways we implement to inform the user. As long as no name is provided:
* We decorate the name filed with an error icon
* We provide a meaningful error message in the title area of our page
* We disable the finish-button
h1. **
h2.
h2. Let us start with a text widget
To start, we need a text field that will allow the user to enter the name. The classic approach would be to create a SWT text wiget and attach a ModifyLlistener to it. We would implement this listener and validate the user input. Jface databinding spares us from writing this listener:
Text nameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
IObservableValue observableText = WidgetProperties.text(SWT.Modify).observe(nameText);
JFace databinding operates on *Observables*. Observables provide a standardized observer pattern used across jface databinding. No matter what you observe, a widget, a bean, etc. you always listen to changes that occour in a jface observable.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-106... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
The code shown above attaches a ModifyListener to the text field and wraps it in an *Observable*. We still have no validation. We'll get to this in a few steps.
h2.
h2. We need a model to store the name
Jface databinding is a framework that is built upon the principle of model-view-controller (*MVC*). It connects a view to a model and transfers the user inputs to the model. It of course also operates the other way round and updates the view if new values are set to the model.
We'll now create a simple bean that holds the name of our connection:
public class CloudConnectionModel extends ObservablePojo {
public static final String PROPERTY_NAME = "name";
private String name;
public CloudConnectionModel(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
getPropertyChangeSupport().
firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
}
}
Our model is a simple bean and provides getters and setter for the name property. It uses PropertyChangeSupport to inform observers about changes to the name of our connection. PropertyChangeSupport, an observer pattern shipped with the jdk, allows us to get informed of changes. Since jface uses *Observables*, we have to wrap our name property to conform to the *Observable* interface:
IObservableValue observableName =
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_NAME)
.observe(connectionModel),
h2.
h2. Databinding, transfer the user input to our model!
Now that we have observables on both ends (model and widget), we can tell databinding to connect both ends. JFace databinding will then propagate user inputs to our model. It will also transfer changes in the model to the widget. A so called *Binding* may be created on behalf of the *DataBindingContext:*
DataBindingContext dbc = new DataBindingContext();
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(nameText),
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_NAME)
.observe(connectionModel));
h2. But hey, names are mandatory!
We now told databinding to transfer the user input to our model. What we still miss is the ability to constrain user inputs.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-106... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
Jface databinding offers the ability to convert and validate values while they are transferred from one end to the other. We can tell databinding to validate the name before it sets the user input to the model. Databinding uses *IValidator* instances for that sake:
public class MandatoryStringValidator implements IValidator {
private String errorMessage;
public MandatoryStringValidator(String errorMessage) {
this.errorMessage = errorMessage;
}
/**
*
* validates the given string. Validation passes only if the given value is
* not <tt>null</tt> and it's length's larger than 0
*
*/
public IStatus validate(Object value) {
if (!((value instanceof String) && ((String) value).length() > 0)) {
return ValidationStatus.error(errorMessage);
}
return ValidationStatus.ok();
}
}
The validator shown above validates ok if the user provides any name. It fails if no name is set to the text widget.
To instruct jface databinding to use our validator, we have to wire it into a so called *UpdateValueStrategy*. As we saw above, databinding transfers values both ways: from the view to the model and from the model to the view. A binding therefore has 2 update strategies. A first one that gets applied when values are transfered from the view to the model and another one that is applied when transferring from the model to the view. We only want to validate names that the user provides. We therefore keep the default (*null*) strategy for updates that occur in the model:
Binding nameTextBinding =
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(nameText),
BeanProperties
.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_NAME)
.observe(connectionModel),
new UpdateValueStrategy().setBeforeSetValidator(
new MandatoryStringValidator("You must name the connection")),
null);
h2. Show me the errors
We now may display the result of the validation. We want the text field to be decorated:
h3.
Field decoration
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-106... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
ControlDecorationSupport.create(nameTextBinding, SWT.LEFT | SWT.TOP);
h3. Wizard page error
We also want to get informed in the title area of our wizard page.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-106... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
A single call to jface databinding achieves this for you:
WizardPageSupport.create(this, dbc);
h3. Finish button enablement
There's a single missing piece: We also want to disable the finish button as soon as validation fails:
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-68-105... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-68...
In the classic approach, one would have to implement *WizardPage#isPageComplete*.
public abstract class WizardPage extends DialogPage implements IWizardPage {
/**
* The <code>WizardPage</code> implementation of this <code>IWizard</code> method
* returns the value of an internal state variable set by
* <code>setPageComplete</code>. Subclasses may extend.
*/
public boolean isPageComplete() {
And here's what you have to do using jface databinding:
h4. Nothing, not a single line of additional code.
*WizardPageSupport#create* displays the validation messages in the title area but also connects the validation state to the page completion state.
h1. All the code you need
To sum up, the whole databinding code looks like the following:
DataBindingContext dbc = new DataBindingContext();
WizardPageSupport.create(this, dbc);
Text nameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
Binding nameTextBinding =
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(nameText),
BeanProperties
.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_NAME)
.observe(connectionModel),
new UpdateValueStrategy().setBeforeSetValidator(
new MandatoryStringValidator("You must name the connection")),
null
);
ControlDecorationSupport.create(nameTextBinding, SWT.LEFT | SWT.TOP);
h1. Conclusion
JFace databinding brings a fresh breath into UI programming compared to what was state of the art when swing was introduced. It lessens boilerplate considerably and brings well adapted paradigms to what's needed when building UIs with java. Your code gets more concise, maintainable and your work gets more effective.
JFace databinding exists for 5 years now and a large userbase made it stable and mature over the years. There's really no reason not to use it. You wont regret it.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15964]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years