[JCA/JBoss] - Re: Opening connection from a marked rollback tx
by adrian@jboss.org
"oglueck" wrote : That makes sense. I don't know if I can reproduce the problem in a reasonably small test case. I can try, but I currently lack the time.
Try
| // BMT bean
| public void recreateRandomRollbackOnly() throws Exception
| {
| UserTransaction ut = ..
| ut.setTransactionTimeout(5); // 5 second timeout
| ut.begin();
| try
| {
| try
| {
| Thread.sleep(10000); // 10 second sleep
| }
| catch (InterruptedException ignored)
| {
| }
|
| // Transaction has timed out here
|
| DataSource ds = ...;
| ds.getConnection().close(); // Oops can't enlist in dead transaction
| }
| finally
| {
| ut.rollback();
| }
| }
|
http://java.sun.com/javaee/5/docs/api/javax/transaction/Transaction.html#...
anonymous wrote :
| RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
| IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
|
If you need to do out-of-bound communication (i.e. read the database
even if the transaction has failed) then you need to use a different transaction,
either RequiresNew or no-tx-connection-manager.
There's nothing you can do in the dead transaction.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107375#4107375
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107375
18 years, 7 months
[JBoss Portal] - Need some hello world portlet help...
by Jboss_ton
Sorry for the newbie question, but I've spent hours trying to find the answer (and experimenting) and I just cannot get something simple to work. If this is documented somewhere, please point me in the right direction, but I couldn't find it...
I installed the basic 2.6.2 GA Portal (with AS) to play around. Got it running fine, could deploy several sample portlets without a problem. Imported one of the samples (just hello world html string) in my Eclipse installation to try and compile it myself and make some changes (just modified the string) - deployed as new war file - worked.
Now I'm trying to deploy two basic (just hello world string html) portlets of my own in one war file, and I'm not able to get instances of these portlets automatically created. I can see the portlets on the portlet definitions tab, but I don't see instances under the instances tab. The strange thing to me is, when I manually try to create an instance using one of the instance ids I defined in portlet-instances, I get an error "An instance with the id MySecondInstance already exist!" - even though it does not show up on the instances tab... When I use a different id, I can create instances and add them to windows without a problem, so something must be wrong with my portlet-instances.xml or -object.xml files, right?
I tried several names for my war file (I thought it had to match the first part of -object.xml, so I tried MyPortlet.war as well).
I do not see any error messages from JBoss...
-----MyPortlet-object.xml--------
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portal Object 2.6//EN"
| "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
| <deployments>
| <deployment>
| <parent-ref>default.default</parent-ref>
| <if-exists>overwrite</if-exists>
| <window>
| <window-name>HelloWorldPortletWindow</window-name>
| <instance-ref>MyFirst</instance-ref>
| <region>center</region>
| <height>1</height>
| </window>
| </deployment>
| <deployment>
| <parent-ref>default.default</parent-ref>
| <if-exists>overwrite</if-exists>
| <window>
| <window-name>MySecondPortletWindow</window-name>
| <instance-ref>MySecondInstance</instance-ref>
| <region>center</region>
| <height>1</height>
| </window>
| </deployment>
| </deployments>
|
------portlet-instances.xml------
| <?xml version="1.0" standalone="yes"?>
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
| "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
| <deployments>
| <deployment>
| <instance>
| <instance-id>MyFirst</instance-id>
| <portlet-ref>MyPortlet</portlet-ref>
| </instance>
| </deployment>
| <deployment>
| <instance>
| <instance-id>MySecondInstance</instance-id>
| <portlet-ref>MySecondPortlet</portlet-ref>
| </instance>
| </deployment>
| </deployments>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107374#4107374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107374
18 years, 7 months
[JBoss Portal] - Re: Need help with debugging
by roth
Hey Boleslaw,
While I was trying to come up with the shortest possible list of steps to reproduce this, I found out that this has nothing at all to do with ldap. Here is what to do to see the effect:
1) build JBoss_Portal_Branch_2_6, deploy the portal, identity and admin
2) log in as admin
3) create a new role called newadminrole
4) create a new user called newadmin, add him _only_ to the newadminrole (no other roles)
5) give access to the admin portal to newadmin
6) give acess to the adminportlet instance to newadmin
7) log out, log in as newadmin
8) go to the 'page layout' page of the default page
9) verify that no portlet instances are listed
Some notes:
- if you log in as admin, the portlet instances are listed
- if you install cms or google widgets, lists of files appear for those
Now, before I create a jira issue. Is this a bug, or did I simply forget to set some permissions?
Thanks a lot,
Tobias
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107355#4107355
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107355
18 years, 7 months