glassfish 1 « Glassfish « JPA Q&A





1. Build a JPA application with Netbean 6.8 and Glassfish v3    stackoverflow.com

I am trying to learn JPA, and Sun tutorial on JPA ("order" application) is hard to understand. The tutorial does not show me how the mapping between JPA and the actual ...

2. Slow JPA startup    stackoverflow.com

I created the JPA 2.0 entity classes for our whole database (~200 tables), and now each time I rebuild my application and start it for the first time I get these ...

3. Upgrade Glassfish v2 to JPA 2.0?    stackoverflow.com

I'm trying to use Hibernate 3.5.5 with Spring HibernateJpaVendorAdapter on Glassfish V2 but I'm getting the following exception when the Spring context is initialised:

java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:39) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:517) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) The problem ...

4. JPA 2.0 with Glassfish 2.1    stackoverflow.com

Just wanted to find out if its possible to use JPA 2.0 with Glassfish 2.1? Has someone tried it before? I will be using the latest hibernate implementation of JPA 2.0 as the ...

5. glassfish and hibernate    stackoverflow.com


i saw that my glassfish server has a number o updated available, and i`ve noticed between them hibernate 3.5. I was wondering why would glassfish use hibernate. Then i have searched ...

6. Configure Glassfish 3 with Hibernate 3.6    stackoverflow.com

I am trying to configure hibernate 3.6.7 with glassfish 3.1.1. If I just install the module from update-tool in glassfish I get hibernate 3.5... I want to use hibernate search 3.4.1 Final. I want ...

7. GF/Hibernate save without calling save explicitely?    java.net

I am using GF 2 and container managed persistence with Hibernate 3.2 as provider. I have some finder method in my business logic, which manipulates some persistent entities, which have been fetched via the EntityManager. The manipulation is just changing a String property (deleting an element from a collection leads to the same effect). I do not call anything like save ...

8. Glassfish 2.1 + JPA 2: need some expert advice    java.net

in order to improve application Mapping for my client, i need to migrate from JPA 1 to JPA 2 and deploy it on Glassfish 2.1 (constraint from existing context, no way to deploy it on Glassfish 3.1). For begining, I updated config files (persistence.xml etc..) and successfully ran my application on Tomcat 6 with JPA 2 annotations. Next i deployed it ...

9. Glassfish 3.1 with Hibernate    java.net

org.glassfish.deployment.common.DeploymentException at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:166) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247) at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145) at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:577) at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:463) at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:395) at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380) at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:213) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Caused by: java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:173) at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:119) at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213) at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486) at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:290) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:86) at ...





10. Glassfish v2.1.1, JPA2 and JASIG CAS    java.net

Hi, I managed to install JASIG CAS (3.4.8) on GFv2.1.1 server. CAS requires JPA2, so I had to make some GF customizations. I have: - removed toplink-essentials libraries from gf_intall_root/lib that are JPA1 compatible - added jpa2-api lib to gf_install_root/lib and in domain.xml in classpath-prefix to make domain load it - changed deploy-xml-validation to "parsing" to avoid deployment error when veryfing ...

11. Hibernate 2.1.7 on Glassfish 2.1.1    java.net

I am facing to problem to migrate an older application to Glassfish. The application is using Hibernate 2.1.7 with cglib-full-2.0.2.jar. I am not able deploying as Exception coming from asm.jar level. (this version of hibernate and cglib is using asm-1.5.x and same version of asm-attr.jar). Finally I have found as asm-3.1.jar is part of /glassfish/lib/. Can I simply remove it from ...

12. Hibernate 3.6 on GF 2.1?    java.net

13. Hibernate 3.6.0    java.net

Ronak Patel wrote: > > Hi, > > Yes that's an add-on you install via the Update Center. The reason I put > Hibernate into the shared classloader is specifically because I have > multiple > war files all using Hibernate and don't want Hibernate to be loaded into > memory > more than once. I'm not sure if the OSGI ...

14. Hibernate support for Glassfish: request for comments    java.net

On 08/14/11 12:55, Laird Nelson wrote: > I've updated my Hibernate support for Glassfish project > (https://github.com/ljnelson/hibernate-ips). This project creates an > IPS package for Hibernate 3.6.6 and reworks the pom.xml so that > upgrading future versions of Hibernate should require no more than a > property and a dependency change. > > Please let me know how it works for ...

16. JPA failure with gfv301 and the Petstore2EA5 sample from Sun Java Blueprints    java.net

when i use the same Entity classes in a standalone POJO app using JPA, with RESOUCE LOCAL, anytime an Item instance is persisted by em.persist(item) ;, i always get back from em.contains(item) the value true; the item does get put into the derby database; but the PKey field stays null in the local copy;





17. JPA failure with gfv301 and the Petstore2EA5 sample from Sun Java Blueprints    java.net

when i use the same Entity classes in a standalone POJO app using JPA, with RESOUCE LOCAL, anytime an Item instance is persisted by em.persist(item) ;, i always get back from em.contains(item) the value true; the item does get put into the derby database; but the PKey field stays null in the local copy;

19. Re: Using Hibernate on Glassfish?    java.net

On Wednesday 04 May 2011 06:54 PM, Richard Kolb wrote: > Hi Sahoo > > On 4 May 2011 15:11, Sahoo > wrote: > > Mitesh's proposal does not require use of Hibernate as a set of > OSGi bundles. Just copy Hibernate and its dependencies to > domain/lib and you should be done. GlassFish's use of SLF4J won't > be ...

20. Using Hibernate on Glassfish?    java.net

> Hello; I am looking for the latest and greatest document regarding the > proper way to install Hibernate into Glassfish for all applications deployed > on the application server. > > This question ( > http://stackoverflow.com/questions/594079/is-it-possible-to-use-hibernat...) > seems to indicate that (a) this information used to exist, (b) may exist > again and (c) changes on a regular basis. > ...

22. Glassfish + Hibernate    java.net

23. Glassfish+Hibernate - can't have more than one app?    java.net

ADM1006:Uploading the file to:[C:\Documents and Settings\myuser\Local Settings\Temp\s1astempdomain1server-733637094\GFTest.ear] wsgen successful DPL5306:EJB Web Service Endpoint [CustomersWSBean] listening at address [http://myuser.mydomain.local:8080/CustomersWSBeanService/CustomersWSBean] deployed with moduleid = GFTest ADM1041:Sent the event to instance:[ApplicationDeployEvent -- enable GFTest] Attempt to restart an already started EhCacheProvider. Use sessionFactory.close() between repeated calls to buildSessionFactory. Consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider. Error from ehcache was: Cannot parseConfiguration CacheManager. Attempt to create a new instance ...

24. Hibernate 3.2.0 CR3 w/ JPA breaks in glassfish    java.net

I have experienced this recently while trying to use latest Hibernate. I don't think there is any issue with Hibernate here. It looks like you have [b]partially[/b] updated the Hibernate jar files. Hibernate entity manager depends on Hibernate annotations. So you need to get the compatible version of [b]Hibernate Annotations[/b]([u]hibernate-annotations.jar[/u]) as well. org.hibernate.cfg.annotations.QueryBinder.class has changed and it no longer references the ...

25. jpa unpredictable    java.net

jpa is so unpredictable, even if you refresh the entity, you can't tell if those with @OneToMany annotations will be refreshed, if its not your day, it will even empty the List, if your half-lucky, some data will trickle down, if your really lucky, it even gets fully refreshed. by the way, those one to many have cascade={CascadeType.REFRESH, CascadeType.REMOVE}. this technology ...

27. JPA + web 2.4, is possible ?    java.net

I'm trying to use JPA in RESOURCE_LOCAL opposite JTA at transaction-type, but in this case I have problens with JavaDB. I not using JavaDB to store my data, I using PostgreSQL, but my application allways connect to a JavaDB on deploy, I allready try to shotdown the JavaDB, but i these exception:

28. JPA One2Many special case    java.net

I use JPA for persistence. I want to persist objects in one transaction in order to keep data integrity. Now Many2Many and One2Many/Many2One all works fine. For example, I have 1. Animal.java, 2. Food.java, 3. Owner.java. Animal M2M Food (Linktable Animal_Food), and Animal M2One owner. I can persist all objects in one EntityManagement transaction:

29. JPA and clustering    java.net

30. JPA: having sum    java.net

the issue is the expression p.betrag in the aggregate function of the HAVING clause. The current version of the Java Persistence query language only supports aggregates functions over grouping expressions in the HAVING clause and p.betrag is not a grouping expression. Here is what the spec defines on page 98: "The HAVING clause must specify search conditions over the grouping items ...

31. How to use/run JPA in a JSE platform?    java.net

Unfortunately these examples turn out to be out of date (wrong) or they only work for NetBeans or only in a Web container. The examples I have found on the blog links in the message above don't actually work - the format of persistence.xml is invalid (the property tag requires a value attribute) and the location of persistence.xml is wrong (it ...

32. catching JPA NonUniqueResultException    java.net

glassfish@javadesktop.org wrote: > hi, > > > I have a method in an EJB that calls entityManager.createNamedQuery("query").getSingleReslt(); > > > EM.getSingleResult() throws 'NonUniqueResultException' unchecked exception if more than one result were returned, > > I declared my EJB method as: > > public void loadEntities() throws NonUniqueResultException; > > > > but when the exception occures, an 'javax.ejb.TransactionRolledbackLocalException' exception is thrown ...

33. modularity and jpa    java.net

Hello. I am actually creating a netbeans suite, which depends on multiple modules. The scheme here is not specific to netbeans, it could be the same with any application that uses multiple jars, and might have other ones coming anytime. It is just to give an idea of the type of modularity. I have modules with each having entity classes. Some ...

34. Simple JPA demo for Java SE    java.net

> > > > > > 4. Create this Java class with Person persistent object - > > package testjpa; > > import javax.persistence.*; > import java.util.*; > > public class TestJpa1 > { > static private java.io.PrintStream out = System.err; > > public static void main(String args[]) > throws Throwable > { > EntityManagerFactory emf = Persistence.createEntityManagerFactory("bodega"); > EntityManager em ...

35. quintessential JPA operation    java.net

Some notes. There is exactly one tx.commit() and exactly one tx.rollback(). this is to insure that they are called when intended. I am only catching Exceptions and not Throwables. Im not a big fan of catching Throwable since you can swallow really critical errors, like OutOfMemmoryError. Some improvements that come to mind, though I am not sure about, are that the ...

36. basic jpa collection question    java.net

I've been searching for this and looking in the spec but I don't see the answer. I know that you can have an entity with persistent field or property of type enum or Integer. Is it possible to specify a Collection(set or list) of something like Set or Set? And if so could you give an example. Or will I need ...

37. TLE vs Hibernate    java.net

In all of our apps, we are currently using Hibernate as the JPA provider due to what we (read as, I) understood to be a bug in TLE with regard to SequenceGenerators and PostgreSQL. I'd really like to use TLE, as I'm not a big fan of the extra configuration step in setting up our applications, nor am I, as our ...

38. Webstart and JPA - no suitable driver found    java.net

Then lease open an issue using IssueTracker and [b]please[/b] attach a simple example EAR that illustrates the problem, along with any set-up information we'd need. Tell us whether it works or fails with the appclient script launch. Also help us by telling which other db you are using and point us to the driver you downloaded so we are using exactly ...

40. JPA    java.net

Very basic question: I have an app that I use JPA to access a MySQL database. When I add rows into a table using MySQL utilities, I don't see them im my application when I use the entity manager. I know TopLink uses cache, so how do I make it refresh so that I can get the added rows...

41. Same app twice using JPA    java.net

After solution for having two applications using JPA on same server (thank you guys! it's working like a charm), now I need to deploy same application (using same PU name) twice on same server. The problem appear be the PU name and cache, that is loosing it's references (or mixing up information, and giving "class cast exception" for latest deployied one. ...

42. Which JPA Implementations work?    java.net

I also used openJPA some time ago. I just neded to drop the jars into GF and modify the persistence provider property in my persistence.xml. It even was easily possible to switch between toplink and openJPA. From my experience I can say that the openJPA devs are very cooperative, if you have any trouble using openJPA.

44. JPA cacade remove operation: Spec vs. TLE implementation    java.net

After using the JPA cascade entity operation feature, I had several problems when removing entities from the database, that should cascade their remove operation to dependent entities as this results in a database constraints violation. There are several issues already filed, but it seems they have low priority/importace (P4), thus impliying that it is not a mandatory feature required by the ...

45. [JPA] BUG in the class weaver    java.net

46. JPA Generated Values issue    java.net

Now, I understand that by default they use 50 as an increment for the auto generator, but I'm surprised that this happens and gets boosted for every use of the EntityManager, rather than for each use of the EntityManagerFactory. It was my understanding that the EntityManager was lightweight and meant to be used, minimally, once per transaction. So, I'm just kind ...

47. Hibernate not working with GlassFish V2 now??    java.net

#|2007-10-05T17:22:05.958-0700|WARNING|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=10;_ThreadName=main;_RequestID=5190e64f-570e-4296-9a3d-1e67d4e95f16;|javax.naming.NameNotFoundException: ilda not found java.lang.RuntimeException: javax.naming.NameNotFoundException: ilda not found at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(PersistenceUnitInfoImpl.java:283) at com.sun.enterprise.server.PersistenceUnitInfoImpl.(PersistenceUnitInfoImpl.java:116) at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:121) at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:84) at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:898) at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:184) at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126) at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244) at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:225) at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:217) at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:442) at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:120) at com.sun.enterprise.server.PEMain.run(PEMain.java:411) at com.sun.enterprise.server.PEMain.main(PEMain.java:338) 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:597) at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412) Caused by: javax.naming.NameNotFoundException: ilda not found at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216) at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188) at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74) at ...

48. Basic JPA Question    java.net

According to the JPA, all entities must have an identifier UNIQUE amongst all entities of its type. I'm in a situation where objects that I wish to persist all have unique identifiers, but the components of these objects do not...they only have unique identifiers amongst the other components within the object that contains them.

50. Glassfish, JPA, and an IBM AS/400    java.net

When you say there are no primary keys do you mean there are no uniqueness constraints on the database or that the data rows are not unique from each other? Is this for all of your data or just some of it. If the data rows are unique but there are just no unique constraints on the database then you can ...

51. JPA Superclass method    java.net

52. JPA question    java.net

No it's not a good solution, try a book related to JPA, to find better solution for relations and cascades. I couldn't find out the exact relationship between document and template but I feel there is something wrong in your design, that's why you retrieve null. You can try Apress Pro EJB 3 Java Persistence API book. I've found it so ...

53. JPA questions    java.net

One thing I should note before asking the questions: we only read the data in our application and never modify, add or delete the data, so we don't care about persisting the data back. Moreover, we've only got the views of the actual tables and there is no way we can change the bad DB design, or even get better-structured views. ...

54. GlassFish and JPA    java.net

55. JPA and SQL Server 2005's Identity Don't Play Nice    java.net

What I am discovering is JPA and SQL Server 2005 do not playing nice together when you use the IDENTITY capability for a primary key. Let me explain. "...when using the IDENTITY as the generator type, the value for the identity field MAY NOT be available BEFORE the entity data is saved in the database because typically it is generated when ...

56. EJBQL "." Operator semantics and JPA 2.0    java.net

f.baz > 0 always yields a TRUE for any f. So I assumed that I will get all instances of f. It turned out that my assumtion was wrong, because the "." operator has the semantics of an inner join and not the semantics of an outer join. So all instances of f, that had f.bar = NULL did not make ...

58. Glassfish Custom Realm and Hibernate    java.net

Hello all, I have created a custom realm that I can use with glassfish and I have no problems. But when I add Hibernate to my realm I get a stack trace throwing an error when I try to Session s = HibernateUtil.getSession(); Caused by: java.lang.ExceptionInInitializerError at dbUtil.HibernateUtil.(HibernateUtil.java:35) at tkc.WebCopCustomRealm.init(WebCopCustomRealm.java:44) at com.sun.enterprise.security.auth.realm.Realm.doInstantiate(Realm.java:233) at com.sun.enterprise.security.auth.realm.Realm.instantiate(Realm.java:165) at com.sun.enterprise.security.RealmConfig.createRealms(RealmConfig.java:93) at com.sun.enterprise.security.RealmConfig.createRealms(RealmConfig.java:163) at com.sun.enterprise.security.SecurityLifecycle.onInitialization(SecurityLifecycle.java:113) at ...

59. two questions for JPA    java.net

In JPA, is it possilble to get a query result that has return type other an entity bean? For example, table user has userid,username,age. Can I create a JPA Query to return just all userids? another question is say I have another table user2, userid,otherinfo1, otherinfo2 etc. I want to get all info from these two table (one to one connection). ...

60. how to use JPA in standalone java SE project?    java.net

JDBC is an abstract interface for relational database management system. It makes your application unaware of the particular RDBMS product. Your application will need to deal with SQL and tables. The core idea is that you deal with rows and columns. Compared to JPA the programming is more complex but there is less overhead since there is no O/R wrapping.

63. JPA/Hibernate not working with Glassfish :(    java.net

I have read some articles where people did manage to get this to work but I keep getting an exception even with the simplest example. The exception happens on em.persist(). All is packaged inside the .war file. I also tried putting the bean and model class in an ejb jar but it didn't help.

64. Glassfish, JPA and MarshalException    java.net

I reduced the problem to the following. I have a client application which invokes a single method of a stateless bean: it should return a ConversionOutcome object, which is also an @Entity. Now the bean only instantiates a new ConversionOutcome object and returns it. The problem occurs only if I inject the dependency of the PersistenceContext, even if the ConversionOutcome object ...

65. What's advanteges of JPA? Basic question about this technology.    java.net

better performace - AS can cache data: i think there will be no better performnce than our db :) if AS is better than database - i think this company can move their business and instead of AS can sell db servers. And cache on AS is no good idea because our data can be changed using another application which dont ...

66. Autodiscovery of JPA classes    java.net

Jose Noheda wrote: > Hi, > > When deploying to Glassfish including a persistence.xml in the WAR > file (inside META-INF) only the WEB-INF/classes are discovered by > Hibernate. If I place it in a JAR (later included inside WEB-INF/lib) > only the jar classses are correctly detected. Is there any way to load > both? > > Regards

67. Glassfish v2.1 Hibernate    java.net

But simple copying the jar files to the Glassfish lib is not enough, I still get errors when running a simple test application. By the way, some required JAR files are not available in the latest Hibernate distribution and can only be found in some older ones. And the patch from the second link cannot be found, either and at the ...

68. ContextInitialized method - Hibernate    java.net

Ive a ServletContextListener and a contextInitialized method because I need to make come actions at my glassfish application startup. One of these action y a query to a database using a ORM (Hibernate). The problem is that it seems that at this point (contextInitialized) Hibernate hasnt finished the mapping files so i get this error:

69. the best JPA Implementation?    java.net

For the record, we use Toplink here because it's handy, requires 2 jars, and seems to do the work. That said, we are eager and hungry for JPA 2.0, just not enough to want to switch to Hibernate or Eclipse Toplink in the interim. We've already worked around most of the issues, so we're sticking with it.

70. JPA question    java.net

Daniel H. Cavalcanti wrote: > Hi, > > I have a question about JPA. I have an enterprise application that > contains two ejb modules and a web module. > > One of the ejb module I call persistence, which contains all my entity > classes and facade classes to manage the data in the database. > > The other ejb ...

71. JPA SSL J2SE    java.net

73. JPA design question    java.net

I need to have an entity that needs to reference two other entities. For the majority of the use cases, only knowing that the reference to the other entities exists is sufficient; the relationship will not generally be traversed. However, if the referenced entities are removed, then the first entity needs to be updated and the references cleaned up.

74. JPA Standalone    java.net

75. JPA: Preload data    java.net

The hot tip is to simply leverage when the application starts up (using, say, a Servlet or webapp lifecycle listener) and "check" if your database is loaded. For example, you could create a simple control table. If that table has no rows in it, it's safe to assume you have never performed the preload.

76. JPA and Glassfish    java.net

77. Hibernate strange behavior    java.net

glassfish@javadesktop.org wrote: > Hello, I'm using hibernate 3 with Glassfish 9.1_02 > > I'm having some issues with transactions, according to Hibernate documentation, the use of org.hibernate.transaction.JTATransactionFactory lets Hibernate to check weather a Container Managed Transaction is running and if so relying on that, otherwise creates a new transaction using a new transaction (looking up for java:comp/UserTransaction). > my code is ...

78. Glassfish v3: Trying to create a Hibernate based JPA application    java.net

FINA: No local string for exceptionwebapphasnoentitymgrrefbyname FINA: No local string for exceptionwebapphasnoentitymgrfactoryrefbyname GRAVE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method java.lang.RuntimeException: javax.naming.NameNotFoundException: lamateria not found at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.(PersistenceUnitInfoImpl.java:107) at org.glassfish.persistence.jpa.JPAApplication.loadPU(JPAApplication.java:175) at org.glassfish.persistence.jpa.JPAApplication.loadAllPus(JPAApplication.java:156) at org.glassfish.persistence.jpa.JPAApplication.(JPAApplication.java:92) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:447) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:173) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329) at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302) at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312) at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119) at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180) at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633) at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570) ...

79. Glassfish v3: Trying to create a Hibernate based JPA application    java.net

2009/4/17, Sahoo : > That feature may not yet be implemented in v3. > > It is a bit surprising that you have created a resource and yet you are > getting a NameNotFoundException. May be you should send your > persistence.xml as well as domain.xml for us to look at? > > Sahoo > Nicols Lichtmaier wrote: >> Already tried ...

80. JPA issue after republish    java.net

81. Custom MBeans and JPA. It's possible?    java.net

Hello. I'm new to Glassfish and J2EE. One requirement of my current project is to verify periodically if certain data exists in the database (and if not exists it must generate and insert that data). Searching on the web I found that Glassfish is capable of execute some actions (like sending email) when some events occurs (triggers, lifecycle, etc). I implemented ...

82. JPA + Hibernate + Enumerations    java.net

In resume, what i want is that my domain classes acts as persistent enumeration only for predefined values. But not an Integer nor a String but just any domain class. I know about the Hibernate UserType class but i guess that one isn't designed for the same purpose, cause i want not only to have enumerated values but also normal instances ...

83. JPA 2.0 MetaModel on GFV3    java.net

84. Hibernate in GF 2.1.1 vs 2.1    java.net

javax.persistence.PersistenceException: No Persistence provider for EntityManager named Personalization: Provider named org.hibernate.ejb.HibernatePersistence threw unexpected exception at create EntityManagerFactory: java.lang.NoSuchMethodError java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V at net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter.java:47) at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorSt rategy.java:30) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy .java:24) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java: 216) at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLaz yInitializer.java:117) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyF actory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTu plizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTupli zer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java :55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEn tityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:302) ...

85. UserTransaction for JPA During the whole web request    java.net

1. How can I leave the UserTransaction open for the duration of the request and thus having the EntityManage stay alive to load the lazy collections? (I used to accomplish that using a custom servlet that call begin() method of UserTransaction when the service() method started and call commit or rollback when it ends.

87. WAR packaging, JPA and CDI question    java.net

Hi. I have been working to fix a solution for this issue: http://forums.java.net/jive/thread.jspa?threadID=74047&tstart=0 and wanted to test a scenario like this one: 1. there is a JPA module, that has the META-INF/persistence.xml file 2. EJB module that has 2 SLSBs, but use the persistence context from the unit defined in the first module ; bean1 uses @PersistenceContext injection, whereas bean2 uses ...

88. Nullable columns in JPA2.0    java.net

In JPA 2.0 annotations, there I feel a misperception about nullable columns. There are two annotations to set a property to be nullable or not. @Column(nullable = true) & @Basic(optional = true) What is the difference of these two in setting a filed nullable/not-nullable? There exists situations that I see both annotations are held on a property/field with a value set ...

89. Hwo to use Jpa on servlet    java.net

On Wednesday 09 June 2010 04:01 PM, glassfish@javadesktop.org wrote: > Thank you Sanjeeb, > may I have two more questions. > 1) Can I create the table on the db first then alow the user register by servlet by jpa? > Of course you can. Don't use createtable option during deployment and ensure that the mapping you specify in the Java ...

90. Severe Messages with Hibernate    java.net

91. Java EE + JPA questions    java.net

JPASetFirstResult.java ---------------------------------------------------------------------------- import java.util.Iterator; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; public class JPASetFirstResult { public static void main(String[] args) { EntityManagerFactory emf=null; EntityManager em=null; try{ emf=Persistence.createEntityManagerFactory("test"); em=emf.createEntityManager(); EntityTransaction entr=em.getTransaction(); entr.begin(); Query query=em.createQuery("SELECT st FROM Student st"); query.setFirstResult(2); List stuList=query.getResultList(); Iterator stuIterator=stuList.iterator(); while(stuIterator.hasNext()){ Student st=(Student)stuIterator.next(); System.out.print("sname:"+st.getSname()); System.out.print("sroll:"+st.getSroll()); System.out.print("scourse:"+st.getSname()); System.out.println(); } entr.commit(); }catch(Exception e){ System.out.println("Exception ==> "+e); ...

92. Hibernate + ConnectionPool    java.net

Hi all, I have setup a connectionpool in glassfish server. What are the steps needed to make my hibernate enabled application to use that connectionpool? does it have to be Java Web application? the reason i'm asking this because i have a Java Web project started in netbeans but all i have is a bean class for hibernate and another class ...

93. Glassfish 211 hibernate 2    java.net

95. JPA AdvancedMapping sample    java.net

Hi everybody, I was looking to the jpa advancedmapping sample which is shipped with GlassFish Enterprise Server. I don't know if there's someone who took a look at it. I found something that is rather wierd. What the lineItemNumber attribute in the LineItem class, is for ? Looking at the EJB code doesn't help very much, it just seems that it's ...

96. Hibernate 3.6.0    java.net

Yes that's an add-on you install via the Update Center. The reason I put Hibernate into the shared classloader is specifically because I have multiple war files all using Hibernate and don't want Hibernate to be loaded into memory more than once. I'm not sure if the OSGI model of Glassfish prevents that even if you put Hibernate into the Web ...

97. GlassFish connectionPool    forum.hibernate.org

Please can someone tell me how to make my hibernate enabled application connect to a database through glassfish *connectionpool* that i have already configured in glassfish. Please note that Connectionpool was tested and working fine with other deployed applications. Should my application be deployed to glassfish server in order for hibernate to use connectionpool in glassfish! Thank you.

98. Installing Hibernate 3.6.x in Glassfish 3.1?    forum.hibernate.org

I am interested in finding out the proper way to install Hibernate 3.6.x in Glassfish 3.1. I am in the process of getting the Glassfish team's recommendations here, but figured that I'd also ask for the Hibernate team's recommendations. No official documentation in either community exists, which surprises me. I have to assume that some--which ones?--of Hibernate's dependencies, for example, are ...

99. Glassfish 3.1 Open Source Edition and Hibernate 3.6.6 Final    forum.hibernate.org

Does Hibernate 3.6.6 Final and Glassfish 3.1 have incompatibilities in bean-validator.jar and validation-api-1.0.0.GA.jar ? Following scenario: I start the web application in Eclipse 3.6 with the command "Debug As -> Debug on Server" and i choose the Glassfish Server as Server to run the application with. When Hibernate tries to build the SessionFactory it throws the Exception org.hibernate.validator.HibernateValidator cannot be cast ...

100. OpenEntityManagerInViewFilter on Glassfish doesn't work    forum.hibernate.org

OpenEntityManagerInViewFilter org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter OpenEntityManagerInViewFilter spring