Can't get PersistenceUnit to work
Hi all,
I am setting up the Netbeans 6.0 IDE with JSF1.2, Tomcat 6.0 and Hibernate through JPA. I am newbie on JavaEE though not on JavaSE and Netbeans. However I am having painfully difficulties in making some tests and trials, to gain deeper knowledge of the technologies involved in such JavaEE applications.
My problem is that can't create an EntityManager, because Hibernae doesn't locate de data source.
Any guide point is highly appreciated. Many thanks for your help.
My context.xml and persistence.xml are as follows:
Exception:
++Caused by: org.hibernate.HibernateException: Could not find datasource++
++at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)++
<---- context.xml ---->
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/EnsayoJavaServerFaces">
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="10" maxWait="-1" name="coreba" password="" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/coreba2" username="root"/>
</Context>
<---- ------------>
and
<------- persistence.xml ----------->
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="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">
<persistence-unit name="EnsayoJavaServerFacesPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>coreba</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
<-- -->
Well in fact it is a bit more basic than that....
I tried the examples with InitialContext and didn't work, such as...
Context context = new InitialContext();
Context envCtx = (Context) context.lookup("java:/comp/env");
Hashtable ht = envCtx.getEnvironment();
DataSource ds = (DataSource) envCtx.lookup("java:comp/env/jdbc/Coreba");the way I saw the datasource was correct, was creating a jsp page (without faces) as a test, extracted from one of the links you sent me...
this doesn't make much sense to me... i can't figure out what i am missing...
Following the content of the testDataSource.jsp file, which worked!... therefore I presume the datasource is correctly settled...
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<sql:query var="rs" dataSource="jdbc/Coreba">
select TITULO_INCIDENCIA from incidencias
</sql:query>
<html>
<head>
<title>Coreba Test</title>
</head>
<body>
<h2>Results</h2>
<c:forEach var="row" items="${rs.rows}">
Título = ${row.TITULO_INCIDENCIA}<br/>
</c:forEach>
</body>
</html>
Similar Messages
-
Have entrourage and want to use Mail. Can't get it to work.
I had a macbook and purchased the Microsoft office for Mac which included Entrourage.
I have now purchased a new macbook Pro and want to begin to use Mail rather than Entrourage.
I have Entrourage on my new computer but i can't get it to transfer my information to the the Mail program
I am on Charter.net at my office and sbcglobal.net at home.
How can i get this to work. I can receive on Mail, but i can't send.check your outgoing port settings and make sure it's using a specific port and not the default port, also you might want to check to see if it is using SSL, TLS or any other encryption. Verify the setting from your old machine setup.
-
got my password wrong twice and my mini is disable. I connected to iTunes, but can't get it to work. Can some one guide my through?
If it's showing the red disabled screen due to incorrect passcodes then you may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808 - you should then be able to reset the iPad via your computer's iTunes and restore/resync your content to it
-
HT1151 i have a new apple external dvd drive, and i can't get it to work with my iMac?
I have a new apple dvd drive, I was told it will work with my imac, but when i plug it in ...nothing... iv been for update... still nothing. How can i get it to work???
If it is this drive, note that it is for MBA's and Mini's only:
http://store.apple.com/us/product/MC684ZM/A
Ciao. -
Is there a way to reset my messages account, I can't get iMessage to work on IPad nor Mac osx. Help please this is really frustrating.
Hi,
Is there an iPhone involved ?
If not, what happens if you remove the Apple ID on the iPad and then set it in Airplane Mode (allow a couple of minutes at this point) followed by re-adding the Apple ID ?
What, if any error messages are appearing on the Mac when you try to launch the App or Login to the iMessages server ?
Is the Apple ID linked to an iCloud account ?
In Messages 7 (Mountain Lion) this did not seem to be important but it seems it is in Mavericks/Messages 8
9:14 pm Friday; April 11, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
I bought an IR receiver and an Apple Remote, and I can't get it to work. What am I doing wrong? The receiver is a Lenovo eHome OVU430006/01 USB IR Receiver.
Hello,
You would need to pair the Apple Remote with the receiver. So I would use the generic Mac/PC receiver and follow these instructions:
http://support.apple.com/kb/HT1619
If that doesn't work then check in System Profiler to see if the IR receiver has been recognized by the PowerBook's hardware. You may require the install of drivers for this device to be recognized.
Best of luck -
I have a go daddy email account and I can't get it to work on my iPad
I have a go daddy email account and I can't get it to work on my iPad
Try turning the email account off and then turn it on again. Settings>Mail, Contacts, Calendars>select your gmail account>Off. Go to the mail app and then come back to the account in the settings and turn it on again.
If you can't find any other way for the iPad to accept the password, delete the email account and then add it back onto the iPad. -
I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161. Any ideas?
I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161. Any ideas?
The latest Apple driver support begins with the MP 171.
Here is Ricoh's official driver download page specifically for the Afico MP 161. Note that new drivers for this device were released on Aug 2, and include Lion and Mountain Lion.
Hopefully, this will solve your device issues. -
Iphone 5 went black. Tried pushing on/off and circle at the same time. Worked yesterday and then did it again today. Can't get it to work.
You need to hold those button longer until you see the apple logo, then release, then wait for the phone to boot back up.
-
I just bought a new computer and had files transferred along with itunes to the new computer. I can't get it to work. It doesn't recognize the extensions for itunes. I also tried downloading Quicktime and couldn't get it to download.
iOS: Device not recognized in iTunes for Windows
I would start with:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7 -
I bought a DATAPILOT to transfer pictures to my macbook and can't get it to work. Any suggestions please?
Best if you try and explain what you are trying to acheive.
Iphoto is a different paradigm than you're used to. I don't understand why you are trying to transfer your edited photos back to an external disk.
There are tutorials here
http://www.apple.com/findouthow/photos/
Regards
TD -
I have signed up for adobe conversion to microsoft word and i can't get it to work - can you help me
I have signed up for adobe conversion to microsoft word and I can not get it to work - can you help me?
Hi Mike,
I've checked your account. I see that you just purchased the subscription this morning. The order is still pending processing, which is why you haven't yet been able to log in an use your subscription. It can take 24-48 hours for a subscription to process fully. Once it does, you'll be able to log in and convert files.
I apologize for the inconvenience.
Best,
Sara -
Trying to connect 2010 Mac mini to alba hd tv but can't get it to work, any theories?
Trying to connect 2010 Mac mini to alba hd tv but can't get it to work, any theories?
Welcome to the Apple Community.
The iPad 1 is only able to do basic AirPlay, many providers of programming have blocked their apps from working with AirPlay. -
I just bought Quick time Pro and I can't get it to install. It shows a yellow box in my application folder, but I can't get it to work. Help!
you launch QT then go to its REGISTRATION
-
Downloaded the App Sales Call Manager. I can't get it to work on either my Iphone 4s or my Ipad2? Can anybody advise how to fix or even get back my money that i paid for it?
Contact the app developer for support. A link to their website will be in the apps description in the AppStore.
Maybe you are looking for
-
How to display result of a query in browser?
I have to write a simple application where I use EJB to access a database and then use Servlet/JSP to display the data to a browser. can anyone help me out please?
-
Masking GL account in Manual Bank configuration
I have done a new bank accounting configuration Created the new House bank and Bank accounts , with account key, mainly , main bank , clearing accounts and used the masking for Bank accounts . There are some old bank GL accounts in which last digit i
-
Search feature with dreamweaver template
I'm building a site with products ids, I need to include a search feature that can find a specific product within the site. I found a template in Dreamweaver that includes the search form. How can I learn how to make it work? Is there any script out
-
Establishing ELSTER/DATEV for ERP2005 systems
Hi! I have 2 systems (ERP 2005) landscape and have to set up the ELSTER/DATEV approach for these systems. The system landscape is: DEV-system (Clients: 100 and 200) PRD-system (Clients: 100) We do not have SAP XI, so we need to use SAP Business Conne
-
Verifying if number in a text field will evaluate to a date format
I have a field, FieldA, that contains 6 numbers, (although the field is a text field). I need to know if that field's numbers evaluate to a true date in the format of mmddyy. For example, if FieldA contains 060110, then that would evaluate to a true