[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/Hiberna

[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 = sf.getAllCl

[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 = ((org.jbos

[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:.. | NamingEnumeration list = ctx.listBindings("persistence-units"); | while (list.hasMore()) { | Binding nc = (Binding)list.next(); | Object o = nc.getObject(); | ... | ... does not return the same object

[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 JN

[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] - 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: | org.debtbase.server.entitybeans.LegacyObject | true | The ID generator does not seem to be created now. The exception has gone, and the @Entity bean on this Persistence Unit works p

[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] [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 meta

[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 with

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

2006-08-07 Thread matt10
It is possible to do this by inspecting the bean's own annotations with code, i.e. method @PermitAll, @RolesAllowed, and class defaults. This works. IMHO It would be nice if there was a JBoss method that would allow such method access checks though. View the original post : http://www.jboss.co

[jboss-user] [EJB 3.0] - Re: How to set default mapping to TEXT instead of VARCHAR(25

2006-08-07 Thread matt10
Rather than TEXT I meant I want to set the default to VARCHAR(unlimited length). Is this possible? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963626#3963626 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963626 ___

[jboss-user] [EJB 3.0] - Re: Programmatically query @RolesAllowed or if caller can ac

2006-08-07 Thread matt10
Your code does work as expected. Thanks for your help. I was doing annotation.getClass() instead of annotation.annotationType() on the server-side coupled with a bug on client-side which was not handling the results properly. I had mislead myself that I could not access annotations after seeing

[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 t

[jboss-user] [EJB 3.0] - Re: hibernate.hbm2ddl.auto=create-drop per default ??

2006-08-03 Thread matt10
I just hit this as well when I finally connected my entities to the live database. Argh! Good job I had a backup. Can we change the default please? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962866#3962866 Reply to the post : http://www.jboss.com/in

[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] - 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 >appropri

[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 org.jboss