[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Acces Configuration/Persistent Class at run time for rea

2008-10-09 Thread matt10
In a JBoss EJB3 environment I've never found a way to access the hibernate Configuration object or the metadata it contains e.g. PersistentClass. To my knowledge, this is available at startup time only, and JBoss doesn't provide any access to it. After initialization (at runtime),

[jboss-user] [EJB 3.0] - Re: Accessing EntityManagerFactory/SessionFactory via JNDI s

2008-10-08 Thread matt10
Hi Fiorenzo, You can get a list of entity classes from an EntityManager. Then add code to scan the @NamedQuery and @NamedQueries({ ... }) annotations on those classes and make a list of NamedQuery names. Like this: | // Get all entity classes | org.hibernate.SessionFactory sf =

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Acces Configuration/Persistent Class at run time for rea

2008-10-08 Thread matt10
Hi Ilavenil, If you only have one Persistence Unit, you can get a list of entity classes this way: | // Get all entity classes | org.hibernate.SessionFactory sf = ((org.jboss.ejb3.entity.HibernateSession) em).getHibernateSession().getSessionFactory(); | Map?,? allClassMetadata =

[jboss-user] [EJB 3.0] - Re: Accessing EntityManagerFactory/SessionFactory via JNDI s

2008-09-03 Thread matt10
That works. Thanks so much, jaikiran! :) So the problem is that:.. | NamingEnumerationBinding list = ctx.listBindings(persistence-units); | while (list.hasMore()) { | Binding nc = (Binding)list.next(); | Object o = nc.getObject(); | ... | ... does not return the same

[jboss-user] [JNDI/Naming/Network] - javax.naming.Reference

2008-09-02 Thread matt10
Hi, When looking up EntityManager, EntityManagerFactory or SessionFactory objects in JNDI I'm getting back instances of javax.naming.Reference instead of the correct objects. According to specifications, forum posts and examples I should be able to access these container-managed objects via

[jboss-user] [EJB 3.0] - Accessing EntityManagerFactory/SessionFactory via JNDI serve

2008-09-01 Thread matt10
Hi, I have an application framework which scans the EAR it is contained in for EJB3 entity bean classes and persistence units, to auto-detect them, in order to provide access to data through a facade SLSB. I need to obtain the following programmatically: 1. A list of all Persistence Units 2. A

[jboss-user] [EJB 3.0] - org.hibernate.MappingException: could not instantiate id gen

2007-10-16 Thread matt10
I have to access a legacy application. I have read-only access to it's database (Sybase ASE 12.5). I want to access some of it's tables through Entity Beans in a transparent fashion from a session bean facade (Hibernate Shards style, where a lower ID range goes transparently to the legacy DB).

[jboss-user] [EJB 3.0] - Re: org.hibernate.MappingException: could not instantiate id

2007-10-16 Thread matt10
I have managed to fix this by adding the following to persistence.xml on the persistence unit: | classorg.debtbase.server.entitybeans.LegacyObject/class | exclude-unlisted-classestrue/exclude-unlisted-classes | The ID generator does not seem to be created now. The exception has

[jboss-user] [Security JAAS/JBoss] - Re: Check access to bean methods from bean

2006-08-09 Thread matt10
cgriffith, All my business beans do implement common methods as you describe. InterfaceDef getIntfDef(); FunctionDef[] getFunctionDefs(); These methods inspect access and different types of functionality offered by the session bean that only the bean knows about and return the full set of

[jboss-user] [Security JAAS/JBoss] - Check access to bean methods from bean

2006-08-07 Thread matt10
How do I find out which methods can be called on a session bean by a user from inside a bean method? My fat client application enables and disables menu items and functionality on the client depending on whether the user has access to the methods needed for those actions. On the session bean

[jboss-user] [Security JAAS/JBoss] - Re: Check access to bean methods from bean

2006-08-07 Thread matt10
j2ee_junkie, Thanks for your input. I trivialised my use case as enabling/disabling menu items for the sake of forum post. My client is not so much a fat client as an automatic user interface which exposes business methods directly to the user. It generates forms and offers functionality

[jboss-user] [EJB 3.0] - Programmatically query @RolesAllowed or if caller can access

2006-08-01 Thread matt10
How do I find out programmatically which other methods can be called on a session bean by an authenticated user from in a bean method? From a client I'm trying to query what methods the user can call on the session bean, in order to enable and disable menu items and functionality as

[jboss-user] [EJB 3.0] - How to set default mapping to TEXT instead of VARCHAR(255)

2006-08-01 Thread matt10
How do I set the default mapping of entity bean fields of type String to VARCHAR or TEXT instead of VARCHAR(255) on PostgreSQL and MySQL databases? I do not want an arbitrary 255 char limit to the length of a varchar string. I read a post which suggested using an annotation to set the @Length to

[jboss-user] [EJB 3.0] - Re: @Service bug

2006-07-27 Thread matt10
I have this same problem and it's frustrating. On redeploy of a @Service mbean, I get: javax.ejb.EJBAccessException: Authentication failure at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:68) at