[JBoss Seam] - Transaction failed faces message
by milesif
Hi everybody,
I'm making some experiment with a class that extends EntityHome and overrides persist() in this way (I need to show customized error messages when database constraints are violated):
| @Override
| @Transactional
| public String persist() {
| try {
| return super.persist();
| } catch (Exception e) {
| facesMessages.addFromResourceBundle(SEVERITY_INFO, getMessageKeyPrefix() + "unique", "I got an error" );
| return "persist";
| }
| }
|
When I insert a record that violates a constraint, I catch the exception and add a faces message. The problem is that the <h:messages tag in my page shows my message plus another one that says "Transaction failed", That message seems to be added by the framework after the persist() method has returned. Where does that come from ? How can I eliminate or hide it ?
Thanks in advance for helping
Ciao Francesco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994272#3994272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994272
19 years, 7 months
[Javassist user questions] - Can I instrument CodeConverter at runtime?
by dodomio
Hi everybody,
I'm trying to modify a method of my custom CodeConverter at runtime, as the instrumentation is based on the content of a configuration file. I'm stuck at the error You can see below.
Actually I wrote this:
| public class Main {
|
| public static void main(String[] args) throws Throwable {
|
| ClassPool cp = ClassPool.getDefault();
| Loader loader = new Loader(Main.class.getClassLoader(),cp);
|
| // Get the class and instrument
| CtClass conv = cp.get("pkg.CustomConverter");
| CtMethod m = conv.getDeclaredMethod("init");
| StringBuffer sb = new StringBuffer();
| sb.append("{\n");
| sb.append("CtMethod m1 = thePool.get(\"pkg.Hello\").getDeclaredMethod(\"say\");\n");
| sb.append("CtMethod m2 = thePool.get(\"pkg.Hello\").getDeclaredMethod(\"first\");\n");
| sb.append("insertBeforeMethod(m1, m2);\n");
| sb.append("}\n");
| m.setBody(sb.toString()); // (*) Here I got the error shown below
|
| CustomConverter conv = (CustomConverter) conv.toClass().newInstance();
| CustXlator xlat = new CustXlator(conv);
|
| loader.addTranslator(cp, xlat);
| loader.run(args); // Loads and runs the class pkg.Hello
| }
|
| }
|
CustXlator's onLoad method does simply:
| if (className.equals("pkg.Hello")) {
| CtClass c = pool.get(className);
| c.instrument(converter);
| // converter is an instance of CustomConverter passed as
| // the only parameter to CustXlat constructor
| }
|
while CustomConverter has only the init method that I'm trying to instrument.
I'm stuck at an exception occourring during setBody execution. The stacktrace is:
| javassist.CannotCompileException: [source error] no such class: CtMethod
| at javassist.CtBehavior.setBody(CtBehavior.java:346)
| at javassist.CtBehavior.setBody(CtBehavior.java:315)
| at pkg.Main.main(Main.java:29)
| Caused by: compile error: no such class: CtMethod
| at javassist.compiler.MemberResolver.searchImports(MemberResolver.java:416)
| at javassist.compiler.MemberResolver.lookupClass(MemberResolver.java:392)
| at javassist.compiler.MemberResolver.lookupClassByJvmName(MemberResolver.java:310)
| at javassist.compiler.MemberResolver.resolveJvmClassName(MemberResolver.java:460)
| at javassist.compiler.MemberCodeGen.resolveClassName(MemberCodeGen.java:1064)
| at javassist.compiler.CodeGen.atDeclarator(CodeGen.java:698)
| at javassist.compiler.ast.Declarator.accept(Declarator.java:99)
| at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)
| at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
| at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)
| at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
| at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:285)
| at javassist.compiler.Javac.compileBody(Javac.java:212)
| at javassist.CtBehavior.setBody(CtBehavior.java:340)
| ... 2 more
|
It seems that CustomConverter was unable to resolve CtMethod class!!!
But if I statically modify the init method all is ok.
I really don't know how to solve the problem.
Can someone help me? I'll appreciate it very much!
Thanks in advance, Mauro.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994268#3994268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994268
19 years, 7 months
[JBoss Portal] - Re: Struts Portlet
by rabbuhl
Here are the steps to get struts-demo-for-jboss-portal to work on JBoss Portal 2.4.0:
1. Verify that jboss-portal-2.4.0 is installed and working correctly.
2. Download http://docs.jboss.org/jbportal/samples/struts-demo-for-jboss-portal.zip.
3. Unzip struts-demo-for-jboss-portal.zip.
4. Create a directory called struts-demo and unzip struts-demo.war into this directory.
5. Cd to struts-demo\WEB-INF\lib.
6. Delete portals-bridges-struts-0.2.jar from struts-demo\WEB-INF\lib.
7. Download portals-bridges-src-1.0.zip from http://portals.apache.org/bridges/download.html.
8. Unzip portals-bridges-src-1.0.zip.
9. Copy portals-bridges-struts-1.2.4-1.0.jar to struts-demo\WEB-INF\lib.
10. Zip the struts-demo directory to struts-demo.war.
11. Deploy struts-demo.war to jboss-portal-2.4.0\server\default\deploy.
12. Start up JBoss Portal by running jboss-portal-2.4.0\bin\run.bat.
13. Point your web browser to http://localhost:8080/portal.
14. Login as admin/admin.
15. Click on the admin tab.
16. In the Management Portlet window click on Portlets.
17. Find the Struts Portlet Demo and click on local./struts-demo.StrutsPortletDemo.
18. On the right side of the window type "Struts Portlet" and click the Create instance button.
19. In the Management Portlet window click on Portal. Expand root, then default.
20. Click on default. In New Page Name type "struts" and then click on Add Page.
21. Click on Struts. Find Struts Portlet in the drop-down list. To the left type in "Struts Demo".
22. Click on the Add left button.
23. Click on the Struts tab to see the Struts MailReader Demo.
Since the struts bridge is included in the JBoss Portal can someone at JBoss can update the portals-bridges-struts
jar in struts-demo.war and update the documentation so that it describes how to install the demo using JBoss
Portal 2.4.0 or later?
Can this example also be added to the tutorial documentation in the Reference Guide Tutorials (with a link
pointing to the download for struts-demo-for-jboss-portal.zip)?
Regards,
Richard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994266#3994266
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994266
19 years, 7 months
[JBossCache] - Re: Node clear method bug or problem in my way to use it.
by pitoui
<?xml version="1.0" encoding="UTF-8" ?>
<server>
<classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
<!-- ==================================================================== -->
<!-- Defines TreeCache configuration -->
<!-- ==================================================================== -->
<mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<!-- Configure the TransactionManager -->
<attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
<!--
Node locking scheme :
PESSIMISTIC (default)
OPTIMISTIC
-->
<attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
<!--
Node locking isolation level :
SERIALIZABLE
REPEATABLE_READ (default)
READ_COMMITTED
READ_UNCOMMITTED
NONE
(ignored if NodeLockingScheme is OPTIMISTIC)
-->
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
<!-- Valid modes are LOCAL
REPL_ASYNC
REPL_SYNC
INVALIDATION_ASYNC
INVALIDATION_SYNC
-->
<attribute name="CacheMode">LOCAL</attribute>
<!-- Whether each interceptor should have an mbean
registered to capture and display its statistics. -->
<attribute name="UseInterceptorMbeans">true</attribute>
<!-- Name of cluster. Needs to be the same for all clusters, in order
to find each other -->
<attribute name="ClusterName">JBoss-Cache-Cluster</attribute>
<attribute name="ClusterConfig">
<config>
<!-- UDP: if you have a multihomed machine,
set the bind_addr attribute to the appropriate NIC IP address
-->
<!-- UDP: On Windows machines, because of the media sense feature
being broken with multicast (even after disabling media sense)
set the loopback attribute to true
-->
<UDP mcast_addr="228.1.2.3" mcast_port="45566" ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
ucast_recv_buf_size="80000" loopback="false" />
<PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false" />
<MERGE2 min_interval="10000" max_interval="20000" />
<FD shun="true" up_thread="true" down_thread="true" />
<VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false" />
<pbcast.NAKACK gc_lag="50" max_xmit_size="8192" retransmit_timeout="600,1200,2400,4800" up_thread="false"
down_thread="false" />
<UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false" />
<pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false" />
<FRAG frag_size="8192" down_thread="false" up_thread="false" />
<pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true" />
<pbcast.STATE_TRANSFER up_thread="false" down_thread="false" />
</config>
</attribute>
<!-- The max amount of time (in milliseconds) we wait until the
initial state (ie. the contents of the cache) are retrieved from
existing members in a clustered environment
-->
<attribute name="InitialStateRetrievalTimeout">5000</attribute>
<!-- Number of milliseconds to wait until all responses for a
synchronous call have been received.
-->
<attribute name="SyncReplTimeout">10000</attribute>
<!-- Max number of milliseconds to wait for a lock acquisition -->
<attribute name="LockAcquisitionTimeout">15000</attribute>
<!-- Name of the eviction policy class. -->
<attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
<!-- Specific eviction policy configurations. This is LRU -->
<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
<!-- Cache wide default -->
<region name="/_default_">
<attribute name="maxNodes">5000</attribute>
<attribute name="timeToLiveSeconds">1000</attribute>
<!-- Maximum time an object is kept in cache regardless of idle time -->
<attribute name="maxAgeSeconds">120</attribute>
</region>
<region name="/org/jboss/data">
<attribute name="maxNodes">5000</attribute>
<attribute name="timeToLiveSeconds">1000</attribute>
</region>
<region name="/org/jboss/test/data">
<attribute name="maxNodes">5</attribute>
<attribute name="timeToLiveSeconds">4</attribute>
</region>
</config>
</attribute>
<!-- New 1.3.x cache loader config block -->
<attribute name="CacheLoaderConfiguration">
<config>
<!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
<passivation>false</passivation>
<preload></preload>
<shared>false</shared>
<!-- we can now have multiple cache loaders, which get chained -->
<cacheloader>
<class>org.jboss.cache.loader.FileCacheLoader</class>
<!-- same as the old CacheLoaderConfig attribute -->
<properties>
location=c:\dev\jbosscache
</properties>
<!-- whether the cache loader writes are asynchronous -->
<async>false</async>
<!-- only one cache loader in the chain may set fetchPersistentState to true.
An exception is thrown if more than one cache loader sets this to true. -->
<fetchPersistentState>true</fetchPersistentState>
<!-- determines whether this cache loader ignores writes - defaults to false. -->
<ignoreModifications>false</ignoreModifications>
<!-- if set to true, purges the contents of this cache loader when the cache starts up.
Defaults to false. -->
<purgeOnStartup>false</purgeOnStartup>
</cacheloader>
<!--
org.jboss.cache.loader.JDBCCacheLoader
cache.jdbc.driver=com.mysql.jdbc.Driver
cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
cache.jdbc.user=root
cache.jdbc.password=
true
false
true
false
-->
</config>
</attribute>
</mbean>
</server>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994257#3994257
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994257
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - JBoss Upgraded. Mysql failure
by Logarith
Hi
I have the following problem:
I upgraded from 4.0.4 to 4.0.5 used the jems installer files, cause I got
some error messages with the ...aop.xml. This error is not coming anymore, but luckily a new one comes, which did not appear on 4.0.4
I use mysql 5.0.27 for persistence and i putted the mysql-ds in the deploy directory and the connector to lib.
here is the short version of the error:
INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
16:30:19,125 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.UnknownHostException
MESSAGE: mysql-hostname: mysql-hostname
STACKTRACE:
java.net.UnknownHostException: mysql-hostname: mysql-hostname
at java.net.InetAddress.getAllByName0(InetAddress.java:1128)
at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
at java.net.InetAddress.getAllByName(InetAddress.java:1061)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:137)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2569)
at com.mysql.jdbc.Connection.(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
........ and so on over many,many lines
Thx
Logarith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994255#3994255
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994255
19 years, 7 months
[JBossCache] - Re: Node clear method bug or problem in my way to use it.
by pitoui
treecache.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!-- ==================================================================== -->
<!-- Defines TreeCache configuration -->
<!-- ==================================================================== -->
jboss:service=Naming
jboss:service=TransactionManager
<!-- Configure the TransactionManager -->
org.jboss.cache.DummyTransactionManagerLookup
<!--
Node locking scheme :
PESSIMISTIC (default)
OPTIMISTIC
-->
PESSIMISTIC
<!--
Node locking isolation level :
SERIALIZABLE
REPEATABLE_READ (default)
READ_COMMITTED
READ_UNCOMMITTED
NONE
(ignored if NodeLockingScheme is OPTIMISTIC)
-->
REPEATABLE_READ
<!-- Valid modes are LOCAL
REPL_ASYNC
REPL_SYNC
INVALIDATION_ASYNC
INVALIDATION_SYNC
-->
LOCAL
<!-- Whether each interceptor should have an mbean
registered to capture and display its statistics. -->
true
<!-- Name of cluster. Needs to be the same for all clusters, in order
to find each other -->
JBoss-Cache-Cluster
<!-- UDP: if you have a multihomed machine,
set the bind_addr attribute to the appropriate NIC IP address
-->
<!-- UDP: On Windows machines, because of the media sense feature
being broken with multicast (even after disabling media sense)
set the loopback attribute to true
-->
<UDP mcast_addr="228.1.2.3" mcast_port="45566" ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
ucast_recv_buf_size="80000" loopback="false" />
<PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false" />
<MERGE2 min_interval="10000" max_interval="20000" />
<FD shun="true" up_thread="true" down_thread="true" />
<VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false" />
<pbcast.NAKACK gc_lag="50" max_xmit_size="8192" retransmit_timeout="600,1200,2400,4800" up_thread="false"
down_thread="false" />
<UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false" />
<pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false" />
<FRAG frag_size="8192" down_thread="false" up_thread="false" />
<pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true" />
<pbcast.STATE_TRANSFER up_thread="false" down_thread="false" />
<!-- The max amount of time (in milliseconds) we wait until the
initial state (ie. the contents of the cache) are retrieved from
existing members in a clustered environment
-->
5000
<!-- Number of milliseconds to wait until all responses for a
synchronous call have been received.
-->
10000
<!-- Max number of milliseconds to wait for a lock acquisition -->
15000
<!-- Name of the eviction policy class. -->
org.jboss.cache.eviction.LRUPolicy
<!-- Specific eviction policy configurations. This is LRU -->
5
<!-- Cache wide default -->
5000
1000
<!-- Maximum time an object is kept in cache regardless of idle time -->
120
5000
1000
5
4
<!-- New 1.3.x cache loader config block -->
<!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
false
false
<!-- we can now have multiple cache loaders, which get chained -->
org.jboss.cache.loader.FileCacheLoader
<!-- same as the old CacheLoaderConfig attribute -->
location=c:\dev\jbosscache
<!-- whether the cache loader writes are asynchronous -->
false
<!-- only one cache loader in the chain may set fetchPersistentState to true.
An exception is thrown if more than one cache loader sets this to true. -->
true
<!-- determines whether this cache loader ignores writes - defaults to false. -->
false
<!-- if set to true, purges the contents of this cache loader when the cache starts up.
Defaults to false. -->
false
<!--
org.jboss.cache.loader.JDBCCacheLoader
cache.jdbc.driver=com.mysql.jdbc.Driver
cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
cache.jdbc.user=root
cache.jdbc.password=
true
false
true
false
-->
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994251#3994251
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994251
19 years, 7 months
[JBossCache] - Re: Problem with JBoss JDBCCacheLoader
by archanaa_panda
Thank you so very much for looking into the problem. I was on leave as i had fallen ill and i just saw your reply. Our isolation level is REPEATABLE_READ and we are using REPL_SYNC cache mode
Please find below the complete configuration-
<?xml version="1.0" encoding="UTF-8"?>
|
| <!-- ===================================================================== -->
| <!-- -->
| <!-- Sample TreeCache Service Configuration -->
| <!-- -->
| <!-- ===================================================================== -->
|
| <server>
|
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
|
|
| <!-- ==================================================================== -->
| <!-- Defines TreeCache configuration -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.cache.TreeCache"
| name="jboss.cache:service=TreeCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <!--
| Configure the TransactionManager
| -->
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
|
| <!--
| Isolation level : SERIALIZABLE
| REPEATABLE_READ (default)
| READ_COMMITTED
| READ_UNCOMMITTED
| NONE
| -->
| <!--
| <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
| -->
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <!--
| Valid modes are LOCAL
| REPL_ASYNC
| REPL_SYNC
| INVALIDATION_ASYNC
| INVALIDATION_SYNC
| -->
| <attribute name="CacheMode">REPL_SYNC</attribute>
|
| <!--
| Just used for async repl: use a replication queue
| -->
| <attribute name="UseReplQueue">false</attribute>
|
| <!--
| Replication interval for replication queue (in ms)
| -->
| <attribute name="ReplQueueInterval">0</attribute>
|
| <!--
| Max number of elements which trigger replication
| -->
| <attribute name="ReplQueueMaxElements">0</attribute>
|
| <!-- Name of cluster. Needs to be the same for all clusters, in order
| to find each other
| -->
| <attribute name="ClusterName">TreeCache-Cluster</attribute>
|
| <!-- JGroups protocol stack properties. Can also be a URL,
| e.g. file:/home/bela/default.xml
| <attribute name="ClusterProperties"></attribute>
| -->
|
| <attribute name="ClusterConfig">
| <config>
| <!-- UDP: if you have a multihomed machine,
| set the bind_addr attribute to the appropriate NIC IP address, e.g bind_addr="192.168.0.2"
| -->
| <!-- UDP: On Windows machines, because of the media sense feature
| being broken with multicast (even after disabling media sense)
| set the loopback attribute to true -->
| <UDP mcast_addr="228.1.2.3" mcast_port="48866"
| ip_ttl="64" ip_mcast="true"
| mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
| ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
| loopback="false"/>
| <PING timeout="2000" num_initial_members="3"
| up_thread="false" down_thread="false"/>
| <MERGE2 min_interval="10000" max_interval="20000"/>
| <!-- <FD shun="true" up_thread="true" down_thread="true" />-->
| <FD_SOCK/>
| <VERIFY_SUSPECT timeout="1500"
| up_thread="false" down_thread="false"/>
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
| max_xmit_size="8192" up_thread="false" down_thread="false"/>
| <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
| down_thread="false"/>
| <pbcast.STABLE desired_avg_gossip="20000"
| up_thread="false" down_thread="false"/>
| <FRAG frag_size="8192"
| down_thread="false" up_thread="false"/>
| <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>
| </attribute>
|
|
| <!--
| Whether or not to fetch state on joining a cluster
| NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
| -->
| <attribute name="FetchInMemoryState">true</attribute>
|
| <!--
| The max amount of time (in milliseconds) we wait until the
| initial state (ie. the contents of the cache) are retrieved from
| existing members in a clustered environment
| -->
| <attribute name="InitialStateRetrievalTimeout">15000</attribute>
|
| <!--
| Number of milliseconds to wait until all responses for a
| synchronous call have been received.
| -->
| <attribute name="SyncReplTimeout">15000</attribute>
|
| <!-- Max number of milliseconds to wait for a lock acquisition -->
| <attribute name="LockAcquisitionTimeout">10000</attribute>
|
| <!-- Name of the eviction policy class. -->
| <attribute name="EvictionPolicyClass"></attribute>
|
| <!--
| Indicate whether to use marshalling or not. Set this to true if you are running under a scoped
| class loader, e.g., inside an application server. Default is "false".
| -->
| <attribute name="UseMarshalling">false</attribute>
| </mbean>
|
|
| <!-- Uncomment to get a graphical view of the TreeCache MBean above -->
| <!-- <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
| <!-- <depends>jboss.cache:service=TreeCache</depends>-->
| <!-- <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
| <!-- </mbean>-->
|
|
| </server>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994245#3994245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994245
19 years, 7 months
[JBoss Seam] - Re: Redirecting into view that is inside a directory
by pbrewer_uk
If I understand correctly, then I should explain how navigation rules are supposed to work. This is how your current setup will work: Your /index.jsp will redirect to /home.seam which, in turn will map to a file in your war called /home.xhtml which will then be rendered on the front-end. (Note no navigation rule is involved here.)
The navigation rules are supposed to be used as action outcomes: looking at the seam booking example, there is a login action method that returns an outcome of either "login" or "main" these outcomes are then mapped, in the faces-config.xml file (see below), to views.
Seam also introduces the concept of stateful navigation through the use of Pageflows. Have a look at the seam reference for more info on this.
LoginAction.java extract...
| public String login()
| {
| List<User> results = em.createQuery("select u from User u where u.username=:username and u.password=:password")
| .setParameter("username", user.getUsername())
| .setParameter("password", user.getPassword())
| .getResultList();
|
| if ( results.size()==0 )
| {
| FacesMessages.instance().add("Invalid login");
| return "login";
| }
| else
| {
| user = results.get(0);
| Contexts.getSessionContext().set("loggedIn", true);
| FacesMessages.instance().add("Welcome, #{user.name}");
| return "main";
| }
|
| }
|
faces-config.xml extract...
| <navigation-rule>
|
| <navigation-case>
| <from-outcome>login</from-outcome>
| <to-view-id>/home.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>register</from-outcome>
| <to-view-id>/register.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>password</from-outcome>
| <to-view-id>/password.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>main</from-outcome>
| <to-view-id>/main.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>hotel</from-outcome>
| <to-view-id>/hotel.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| </navigation-rule>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994238#3994238
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994238
19 years, 7 months
[JBoss Seam] - Re: Seam 1.1.5 & SeamSecurity...
by sherkan777
I got another question....it is posible to run those SeamSecurity example?
When I deploy project I get an Error:
| 15:42:47,234 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
| 15:42:47,250 ERROR [[/seam-security]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.NullPointerException
| at org.jboss.seam.util.Conversions$FlatPropertyValue.isExpression(Conversions.java:240)
| at org.jboss.seam.Component.getInitialValue(Component.java:357)
| at org.jboss.seam.Component.initInitializers(Component.java:341)
| at org.jboss.seam.Component.<init>(Component.java:248)
| at org.jboss.seam.Component.<init>(Component.java:193)
|
I think Seam needs somethink : java.lang.NullPointerException
I got jboss-seam.jar in ear file and
el-api.jar
el-ri.jar
jsf-facelets.jar int WEB-INF/lib
jboss-seam.jar is form Beta 1 version.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994236#3994236
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994236
19 years, 7 months
[EJB 3.0] - ejb3-timer-service.xml with PostgreSQL
by Juergen.Zimmermann
In ejb3-timer-service.xml I made these changes:HSQLDBDelegate -> PostgreSQLDelegate
| qrtz_job_details: BINARY -> oid
| IS_VOLATILE VARCHAR(1) -> IS_VOLATILE boolean
| qrtz_triggers: BINARY -> oid
| IS_VOLATILE VARCHAR(1) -> IS_VOLATILE boolean
| qrtz_blob_triggers: BINARY -> oid
| qrtz_calendars: BINARY -> oid
| qrtz_fired_triggers: IS_VOLATILE VARCHAR(1) -> IS_VOLATILE boolean
| REQUESTS_RECOVERY VARCHAR(1) -> REQUESTS_RECOVERY boolean
When starting JBossAS I get this error message and stack trace although server/default/deploy/postgres-ds.xml defines DefaultDS:2006-12-15 11:24:27,882 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss.ejb:persistencePolicy=database,service=EJBTimerService state=Create mode=Manual requiredState=Installed
| java.lang.IllegalStateException: Cannot find datasource meta data: jboss.jdbc:datasource=DefaultDS,service=metadata
| at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.init(GeneralPurposeDatabasePersistencePlugin.java:101)
| at org.jboss.ejb.txtimer.DatabasePersistencePolicy.startService(DatabasePersistencePolicy.java:92)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
| 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:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:184)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
| at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:198)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:709)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:429)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:538)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:472)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:320)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:190)
| at org.jboss.system.ServiceController.doChange(ServiceController.java:656)
| at org.jboss.system.ServiceController.start(ServiceController.java:431)
| at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:124)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:85)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:44)
| at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:53)
| at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
| at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:145)
| at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:440)
| at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:451)
| at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:381)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:366)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:246)
| at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
| at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:401)
| at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:340)
| at org.jboss.Main.boot(Main.java:210)
| at org.jboss.Main$1.run(Main.java:508)
| at java.lang.Thread.run(Thread.java:595)
Any hint is appreciated!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994230#3994230
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994230
19 years, 7 months