[JBoss Portal] - Re: how to hide a portlet/pages that user doesn't have view
by zerrt
I have this same problem. It seems you can hide a page from a user, but setting permissions on a window has no effect. So if I have a page with three portlets on it and I want to hide one of them I can't do this by setting the view permissions on the window for that porltet to admin only. If I set the view permissions on the portlet itself Then you see the portlet window with an access denied message. This is not I want to happen obviously.
I also have similar problems with permissions on the edit view. I want to have a portlet be visible to everyone but only be editable for admin users. If I go to the instance security settings for some reason I see only a view option that I can configure even though my portlet supports the edit mode. This occurs for all portlets even out of the box ones like the news portlet that clearly support the edit view. Setting the window permissions to personalize/personalize recursive on the portlet window has no effect. Right now the only permissions that actually seem to work are page wide permissions for view. Even if I set the whole page to personalize/recursive to admin only I can still edit any portlet on the page as a guest.
It seems either I am doing something wrong or the permission system doesn't work at all.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971469#3971469
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971469
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - AbstractEntityManagerImpl.persist in Embeddable EJB 3.0 usin
by christophe.laumond
Hi all,
I'm using Seam 1.0.1GA which means Hibernate as persistence layer.
I have done a TestNG test for testing my Data Access EJB which are using hibernate using the SeamTest class.
This means that my Data Access EJB is deployed and my test is accessing it as a Seam component.
TestNG is using Microcontainer and Embeddable EJB3.
According to the log trace, the following hibernate version are used :
Hibernate EntityManager 3.2.0.CR1
Hibernate Annotations 3.2.0.CR1
Hibernate 3.2 cr2
The test is working perfectly when I use the compiled class files directly.
Then I have packed the classes files in two different jar files :
- the first contains the Entities
- the second contains the Data Access Objects using the EntityManager
I got the following error :
anonymous wrote : [testng] ERROR 14-09 09:54:35,609 (Log4JLogger.java:error:119) -persist failed
| [testng] java.lang.IllegalArgumentException: Unknown entity: accountingAudit.businessObjects.Publicationstatus
| [testng] at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:189)
| [testng] at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:175)
| [testng] at accountingAudit.dataAccessObjects.PublicationstatusHome.persist(PublicationstatusHome.java:38)
my entity in the first jar files
@Entity
| @Table(name = "publicationstatus", catalog = "accountingaudit", uniqueConstraints = {})
| public class Publicationstatus implements java.io.Serializable {
| ...
| }
My DAO in the second jar files
| @Stateless
| @Name("publicationstatusDAO")
| @Interceptors(SeamInterceptor.class)
| @Local
| public class PublicationstatusHome implements PublicationStatusLocal {
|
| private static final Log log = LogFactory
| .getLog(PublicationstatusHome.class);
|
| @PersistenceContext(unitName="entityManager")
| private EntityManager entityManager;
|
| public void persist(Publicationstatus transientInstance) {
| log.debug("persisting Publicationstatus instance");
| try {
| entityManager.persist(transientInstance);
| log.debug("persist successful");
| } catch (RuntimeException re) {
| log.error("persist failed", re);
| throw re;
| }
| }
|
So, obviously this due to the packing in the jar file.
But I don't know if this is due to a missing Hibernate annotations, an error in the Embeddable EBJ3 or anything else...
Any help would be greatly appreciate.
Thanks in advance
Christophe Laumond,
M-ITC Ltd,
Mauritius
I don't know if the error
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971468#3971468
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971468
19 years, 7 months
[EJB 3.0] - ClassCastException deserializing EJB3 Entity Bean
by justinmiller
Hey all,
I'm not quite sure what to make of this problem. I'm getting ClassCastException's deserializing an EJB3 entity bean (as the post title says). The sequence of events is that my client sends an ejb3 entity to the server, to a stateless session bean to persist. The call is made to EntityManager and then (before returning the object to the client) the entity is sent to a jms queue. I've tried placing the entity on the queue both from a @Post-method, and after the call to EntityManager.someMethod() is called. The exception happens when the entity is pulled off the queue (still on the server).
The exception message says something to the effect of: ClassCastException: cannot cast org.hibernate.collections.PersistentBag to java.lang.Integer.
I am extremely stumped. It almost sounds like the entity isn't detached, because it still has hibernate references in the underlying collections. I googled, and I saw talk about trying to write methods to "clense" the POJO of hibernate collections. I fear that this can be difficult and error prone given the potential complexity of the object graph. And besides, I thought the point of EJB3 was to avoid things like that.
Any help would be greatly appreciated! Thanks in advance.
Justin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971465#3971465
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971465
19 years, 7 months