[jboss-user] [JCA/JBoss] - Re: Errors Migrating no-tx-datasource from 4.0.5 to 4.2.2
Ok, I've got the datasources working in a different EAR, so it's not those. Something else is wonky with this EAR. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103517#4103517 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103517 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - Re: Errors Migrating no-tx-datasource from 4.0.5 to 4.2.2
The identical EAR works fine (loads and runs) in 4.0.5 and in 4.2.1. I also see the same error coming out of a fundamentally identical PostgreSQL DS file. Did something change in 4.2.2 regarding no-tx-datasources? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103500#4103500 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103500 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - Errors Migrating no-tx-datasource from 4.0.5 to 4.2.2
Hi All, I'm trying to run a couple applications in 4.2.2. These work fine in 4.05., but I'm seeing errors at startup now: --- MBeans waiting for other MBeans --- | ObjectName: persistence.units:ear=DatabaseImport.ear,jar=DatabaseImport.jar,unitName=MediaWikiDBImporterRole | State: FAILED | Reason: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial | I Depend On: | jboss.jca:service=DataSourceBinding,name=MediaWikiDBImporterRoleDS | | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- | ObjectName: persistence.units:ear=DatabaseImport.ear,jar=DatabaseImport.jar,unitName=MediaWikiDBImporterRole | State: FAILED | Reason: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial | I Depend On: | jboss.jca:service=DataSourceBinding,name=MediaWikiDBImporterRoleDS | | Here's my MySQL DS file: | | | | | MediaWikiDBImporterRoleDS | jdbc:mysql://localhost:3306/MediaWikiDB | com.mysql.jdbc.Driver | username | password | | | | | And here's my persistence.xml: | | org.hibernate.ejb.HibernatePersistence | | java:/MediaWikiDBImporterRoleDS | | | | | | | | In 4.0.5 I had to make this a jta-data-source as that bug alludes to. In 4.2.2 it won't work either as jta or non-jta. Any ideas? Thanks. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103378#4103378 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103378 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - Re: Non Serialized XAResources Warnings with JBoss 4.2, Post
Yay for title truncation. That's PostgreSQL 8.1.9 View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065635#4065635 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065635 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - Non Serialized XAResources Warnings with JBoss 4.2, PostgreS
I'm trying to migrate from 4.0.5 to 4.2, and I'm hitting problems with my datasources. I learned in this process that 4.2 does not support multiple local TX datasources (http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988662). So, I changed my datasources to be XA's. But, now I get these warnings every few minutes for all three of my datasources. | 21:31:10,147 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] Could not find new XAResource to use for recovering non-serializable XAResource < 131075, 28, 26, 1-7f01:ba8a:469ed3e6:2097f01:ba8a:469ed3e6:213 | My questions: What does this mean? What problems will this lead to? Is there an inexpensive solution? Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065634#4065634 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065634 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & Deployment] - Re: Reading Runtime Property Files from EAR
This works: | Properties defaultProperties = new Properties(); | try { | defaultProperties.load(getClass().getResourceAsStream("/default.runtime.properties")); | } catch (IOException e) { | log.error("Unable to open default properties file: " + e.getMessage()); | } catch (NullPointerException npe) { | log.error("Unable to locate default properties file"); | } | Properties runtimeProperties = new Properties(defaultProperties); | try { | runtimeProperties.load(getClass().getResourceAsStream("/runtime.properties")); | } catch (IOException ioe) { | log.error("Unable to open runtime properties file, using defaults: " + ioe.getMessage()); | } catch (NullPointerException npe) { | log.error("Unable to locate runtime properties file, using defaults"); | } | | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060615#4060615 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060615 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & Deployment] - Reading Runtime Property Files from EAR
Hello, I'm trying to introduce runtime properties to my EAR-based application. Ideally I would read in a default properties file, and then an an overrides properties file into a java.util.Properties object to be queried by my application at runtime. Is there a standard way of doing this? The closet thing I've seen is the properties-service.xml mbean, but that looks like it is meant for VM specific properties, not application-specific properties. I've also tried loading the file as a module in my application.xml file but I get an "incomplete deployment" error on startup, even when specifying the alt-dd element. Any suggestions? Thanks, jantzen View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060572#4060572 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060572 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations
I'm facing a similar problem with child entities not being deleted with their parents. The exception I see is "javax.persistence.EntityNotFoundException: deleted entity passed to persist", and it looks like the entity manager is trying to persist the child entities with null references to the parent. I have CascadeType.ALL set on that relationship. I'd be very disappointed to learn that manual deletion of child entities or database-level cascades were necessary, as the whole point of the JPA cascade functionality is to avoid that. But, I don't have a better answer yet. (BTW, I'm also on jboss 4.0.5 and postgres 8.1; it's bizarre that you're hitting a constraint violation and I'm not even getting that far). View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035143#4035143 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035143 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - SessionException: session closed after very large native que
Hi All, I've got a PostgreSQL 8.1 database that I'm performing a series of large queries on under JBoss 4.0.5, and the EntityManager is closing after each query such that the next fails. The queries are native SQL, and return in excess of 250,000 rows. The datasource is defined as non-transactional to avoid transaction timeouts: | | MyDB | jdbc:postgresql://localhost:5432/MyDB | org.postgresql.Driver | ... | ... | | And a suspect persistence unit: | | org.hibernate.ejb.HibernatePersistence | java:/MyDB | | | | | | The thing that's suspect here is the jta-data-source element, when I need this datasource not to be transactional, and I should be using non-jta-data-source. Unfortunately, there's a bug that prevents me from doing that (http://jira.jboss.com/jira/browse/EJBTHREE-433) The EntityManager is injected by JBoss using PersistenceContext, and what I find is that the first query to run will succeed, and get through all of the expected data, but the next query to run will generate a SessionException because the EntityManager is getting shutdown somewhere. So, has anyone else encountered this kind of behavior? Is it likely due to the jta-data-source declaration? Thanks. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005183#4005183 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005183 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Service Beans in Embeddable EJB 3.0?
HI Jazir, I've got the naming properties you describe in place, and I'm looking up stateless beans with the kind of JNDI name you're describing. I'm not sure where EJB Embedded writes its logs though. Which logfile are you looking at? Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997838#3997838 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997838 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Looking up Datasource from Client
Hey Gommo, how's it going? I'm able to do a JNDI lookup for the datasource using the value of the tag. So, I belive this would work for you: | InitialContext ctx = new InitialContext(); | Object ds = ctx.lookup("java:/PostgresDS"); | I'm not clear on why in the datasource config there's no leading "java:/", maybe somebody more knowledgeable about JNDI can explain that. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997798#3997798 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997798 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Unit Testing Practices
Okay, the documentation is wrong. I finally got the embedded server to load my Entity beans, MDBs, and Stateless Session beans, but Service beans are a no go. Anybody know of a workaround? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997774#3997774 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997774 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Service Beans in Embeddable EJB 3.0?
I am trying to use the Embeddable EJB 3.0 server for running unit tests. I've gotten MDB, Entity, and Stateless beans to load and become accessible via JNDI. However, I cannot locate my Service beans via JNDI, and I'm inclined to believe they aren't being started. The documentation suggests Service beans will work: http://docs.jboss.org/ejb3/embedded/embedded.html But I see an exception when I try to look one up: local not bound | javax.naming.NameNotFoundException: local not bound Anyone know of a workaround? Thanks, Jantzen View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997779#3997779 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997779 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Unit Testing Practices
"gommo" wrote : | When my test targets are run the source is compiled in build\ and also most classes are also copied to build-tests (The reason I have done this is the embedded server didn't support all things like ServiceBeans etc..) so I dont copy them over | Are you sure Service beans don't work? According to this they do: http://docs.jboss.org/ejb3/embedded/embedded.html If they don't, that's a deal breaker in my case. Anybody successfully run them in the embedded server? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997446#3997446 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997446 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Unit Testing Practices
Thanks for the help Gommo. I've been trying to get unit tests working inside of my primary development directory tree, which has created problems with finding config files, building properly etc. I'll try a separate test hierarchy like you've got and see if I make it any farther this time. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996214#3996214 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996214 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Unit Testing Practices
Hi Gommo and Tarantula, I'm glad you guys got something working with Embedded JBoss. I guess I'll take a another stab at that approach. How are you bundling and running the tests with your application? In other words, where does Embedded JBoss live compared to the real server, and how do your unit tests find it? Ideally, I'd have Embedded JBoss bundled in with my application so developers could check the whole project out of source control and be able to run the tests, but with 20+ jars that seems unwieldy. Also, are you running the TestNG units from Eclipse? I was unable to load configuration files for the embedded server while running JUnits from Eclipse, so if you have any suggestions there I'd appreciate it. Thanks! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995450#3995450 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995450 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Eclipse IDE (users)] - Re: Memory Leak in JBoss IDE?
Hmm, PermGen space ... Looking at my workspace/.metadata/.log file I see: | !ENTRY org.eclipse.core.jobs 4 2 2006-12-18 18:48:46.390 | !MESSAGE An internal error occurred during: "EL Syntax Validator". | !STACK 0 | java.lang.OutOfMemoryError: PermGen space | | !ENTRY org.eclipse.core.jobs 4 2 2006-12-18 18:48:54.973 | !MESSAGE An internal error occurred during: "JSP Directive Validator". | !STACK 0 | java.lang.OutOfMemoryError: PermGen space | | !ENTRY org.eclipse.core.jobs 4 2 2006-12-18 18:49:03.967 | !MESSAGE An internal error occurred during: "Process resource updates". | !STACK 0 | java.lang.OutOfMemoryError: PermGen space | I'm adding -XX:MaxPermSize=256m to my eclipse.ini file to see if it improves things. Thanks for the suggestion. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995119#3995119 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995119 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Eclipse IDE (users)] - Re: JBoss IDE default server setting
Hi Syed, You should say what version of JBossIDE you're using since there were some pretty big changes from 1.5/1.6 to 2, but here's a guess anyway ... I believe you need to create the server first, since JBossIDE doesn't know where JBoss is installed in all cases and so can't configure it automatically. Try going to Window->Preferences->Server->Installed Runtime and setting up a new JBoss 4 server. Hopefully JBossIDE will pick up on its existence. HTH View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994852#3994852 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994852 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Eclipse IDE (users)] - Memory Leak in JBoss IDE?
Eclipse 3.2.1 JBoss IDE 2.0 beta2 plugin Sun Java 1.5.0_08 (64 bit) Debian I've been seeing tremendous instability in Eclipse ever since migrating from JBossIDE 1.6 to the 2.0 beta. In particular, operations like hibernate code generation and reverse engineering routinely result in crashes. Controlling the JBoss server is enough to do it though. Often there's an out of memory dialog that pops up, mostly it just freezes entirely and I have to kill -9 the process. I've tried bumping up the memory but even with 3/4 Gig of memory it happens. My co-oworker with the same setup on 32 bit Java on OSX sees the same behavior, so it's not the underlying VM implementation that's responsible. And doing non-JBossy things I can keep the Eclipse session going far longer. Anybody else seeing these sorts of problems? I've resorted to opening the necessary files for a given task and then intentionally shutting down Eclipse so that my workbench will be in proper shape after the inevitable crash :) View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994850#3994850 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994850 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Unit Testing Practices
Thanks for the suggestions. But, are these actually capable of testing EJB3s? MockEJB hasn't been updated in two years and I'm doesn't look like it supports dependency injection. JUnitEE is also two years out of date and doesn't work with either JUnit 3.8 or 4.1, and doesn't say what versions it is compatible with. Cactus also seems behind the curve, supporting only J2EE 1.3, and mentioning only EJB2. And it's massively overkill for my testing needs. Hopefully I'm just being dense today, but at this point it's looking like I need to roll my own in-container test runner as a servlet or Service bean. And out of container testing looks out of the question. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993623#3993623 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993623 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Unit Testing Practices
Greetings, Is there a standard way of unit testing EJBs? My goal is to test Entity and Stateless session beans using JUnit, and without deploying them to the server. It looks like EJB3 Embedded is an option, but that seems like a poorly maintained and supported project (still in alpha since last year). Not to mention I have to roll my own solution choosing a subset of the Jars packaged there and somehow integrate them and their configuration files into my application, as it's just a collection of samples and Jars. How are other people handling this issue? Is there discussion elsewhere? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993231#3993231 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993231 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Unable to Connect to C3P0 Connection Pool with JPA under 4.0
Hi All, I'm attempting to connect to a PostgreSQL database via a database pool and seeing some odd behavior: JBoss 4.0.5 c3p0-0.9.1-pre6.jar PostgreSQL 8.1 It looks to me that the pool is starting correctly, as I see it in the logs | 22:26:16,920 INFO [C3P0PooledDataSource] Bound C3P0 PooledDataSource to name 'java:EventDBPool'. Starting... | 22:26:16,951 INFO [PoolBackedDataSource] Initializing c3p0 pool... [EMAIL PROTECTED] ... | 22:26:16,993 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=DataTier.ear,jar=DataTier.jar,unitName=EventDBUnit with dependencies: | 22:26:16,994 INFO [JmxKernelAbstraction] jboss.jca:name=EventDBPool,service=DataSourceBinding | However below I see: | --- MBeans waiting for other MBeans --- | ObjectName: persistence.units:ear=DataTier.ear,jar=DataTier.jar,unitName=EventDBUnit | State: NOTYETINSTALLED | I Depend On: | jboss.jca:name=EventDBPool,service=DataSourceBinding | | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- | ObjectName: jboss.jca:name=EventDBPool,service=DataSourceBinding | State: NOTYETINSTALLED | Depends On Me: | persistence.units:ear=DataTier.ear,jar=DataTier.jar,unitName=EventDBUnit | Here's my c3p0-service.xml: | http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd";> | | | java:EventDBPool | jdbc:postgresql://localhost/EventDB | org.postgresql.Driver | myuser | mypass | 90 | 15 | 5 | true | | jboss:service=Naming | | | And my persistence.xml | | http://java.sun.com/xml/ns/persistence"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | version="1.0"> | | org.hibernate.ejb.HibernatePersistence | java:EventDBPool | | | | | Also, if I create an EntityManagerFactory from that persistence unit directly in my code, I'm able to use it. However, if I use dependency injection via @PersistenceContext it doesn't work. My questions: 1) is there an error in my persistence.xml or c3p0-service.xml preventing startup or connection to the pool? 2) ought I to be using c3p0 still or JBoss's ManagedConnectionPool? Thanks in advance, David View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983368#3983368 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983368 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: How to deploy EJB3 Entity Bean into PersistenceUnit dyna
Probably you'd want to use the programmatic interface to EJB3Configuration to add new Class objects (for the new persistent classes), and then construct a new EntityManagerFactory from it. See this section of the EntityManager docs for the programmatic interface: http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/configuration.html HTH, Jantzen View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982794#3982794 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982794 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Trouble Configuring a Persistence Unit
Well, something got fixed in JBoss 4.0.5 because the same code now works as expected. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982792#3982792 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982792 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Trouble Configuring a Persistence Unit
This is happening with the Java.net AddressBook example (http://today.java.net/pub/a/today/2006/05/23/ejb3-persistence-api-for-client-side-developer.html) too, so it must be an environment configuration issue. Also, I'm able to set up a regular old Hibernate SessionFactory directly and query the database, so there must be something wonky with the bridge connecting the new JPA classes and the Hibernate classes. I'm running JBoss 4.0.4, Eclipse 3.2, JBossIDE 2 Beta. The projects are building with the EJB3 Library which references the JBoss libraries installed under the application server. Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978934#3978934 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978934 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Trouble Configuring a Persistence Unit
Hi, I'm experimenting with the new Java Persistence API interface to Hibernate and running into problems rather fast. My basic test class: | package datatier; | | import javax.persistence.EntityManager; | import javax.persistence.EntityManagerFactory; | import javax.persistence.Persistence; | | public class DataTierTest { | |public static void main(String[] args) { | Object file = ClassLoader.getSystemClassLoader().getResource("META-INF/persistence.xml"); | System.out.println("FILE " + file); | EntityManagerFactory emf = Persistence.createEntityManagerFactory("test"); | EntityManager manager = emf.createEntityManager(); |} | My META-INF/persistence.xml | | http://java.sun.com/xml/ns/persistence"; |xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; |xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"; |version="1.0"> | |org.hibernate.ejb.HibernatePersistence | | | | | | | | | | | | >From within Eclipse and as a Jar running from the command line, the above >results in: | FILE file:/home/jantzen/eclipse/DataTier/bin/META-INF/persistence.xml | Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named test | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:41) | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) | at org.throbbing.datatier.DataTierTest.main(DataTierTest.java:13) | I've verified that META-INF is in the classpath (which the ClassLoader.getResource() call demonstrates as well), so I'm perplexed. Something simple I'm missing probably. Thanks. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978914#3978914 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978914 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user