No suitable driver found for jdbc:mysql://localhost:3306/hibernate - eclipse

I am using Eclipse and making a Web Dynamic Project using Hibernate JPA Annotation:
When I run my project, it gives me the following error:
No suitable driver found for jdbc:mysql://localhost:3306/hibernate
I included the MySQL connector jar file under web-inf/lib folder.
Any suggestions??

Related

Eclipse IDE: java.lang.IllegalArgumentException: Not an managed type

I'm trying to deploy an EAR application on a Weblogic 10.3.3 server. When using the Weblogic admin-console on http://localhost:7001/console/, it works fine. When using Intellij IDEA, it works fine.
However, when deploying from Eclipse Mars, I have the following error, caused by Spring JPA:
Caused By: java.lang.IllegalArgumentException: Not an managed type: class package.xxx.MyClass
at org.hibernate.ejb.metamodel.MetamodelImpl.managedType(MetamodelImpl.java:171)
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:68)
at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getMetadata(JpaEntityInformationSupport.java:65)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:149)
at investmentcafe.ngs.dao.BaseRepositoryFactoryBean$NGSRepositoryFactory.getTargetRepository(BaseRepositoryFactoryBean.java:34)
I'm using Spring 3.2.14.RELEASE, with Spring-data-jpa 1.6.6.RELEASE. The problem occurs on Eclipse Mars.1 (4.5.1 build 20150924-1200), with the Oracle WebLogic Server Tools version 8.4.0.201510191754. I'm deploying "as a virtual application" from the Weblogic tools.
I'm quite puzzled by this strange behavior. Any ideas on how to explain such Eclipse-specific behavior and/or on how to troubleshoot/fix it?
It seems that moving the hibernate .xml file in the META-INF folder fixed the problem. (So the persistence.xml can be renamed, but cannot be moved #GiveEclipseSomeLove)

NoClassDefFoundError on Java EE server in eclipse with tomcat

I'm trying to build a hello world application utilising GCM for Android notifications. When developing the server part, I'm not entirely sure how to get the gcm-server.jar file into the project. I've added it to the build path and Eclipse finds it perfectly fine, but when I build and deploy the project to a tomcat server (from within eclipse) it's throwing the following error at runtime:
java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender
I'm assuming I'm doing something wrong when importing the jar. What exactly is the procedure for getting a jar into a dynamic web project using Eclipse?
Going to answer my own question because I just got it working.
Turns out adding the .jar's to the Java build path is not enough. Tomcat has a seperate classpath for each project, and won't see the classes in the jar unless you dump the jar files into the WEB-INF/lib folder (which Eclipse does not do automatically).
You need to include the jar file for json. This question seems to have been repeated a few times.
http://code.google.com/p/json-simple/downloads/detail?name=json-simple-1.1.1.jar

Configuring JDeveloper to use PostgreSQL

I have a Java project which uses Struts and Hibernate. I am using PostgreSQL as the database for the project.
I have imported the .jws file in JDeveloper. All the java and jsp files are imported to the project.
When I tried to run the project multiple errors came out. I think it's due to a database connection failure.
Do I need to configure pgsql with the project?
Thanks in advance.
You have to provide more info on what the errors are.
But some common problem in JDeveloper when using the bundled server to test is that (if you are using datasources) you have to place the driver jars in the server lib folder or declare it as a Library by going to Tools->Manage Libraries.
If you post what errors are you receiving and how are you connecting to the database we might be able to help you a little more.
You'll need to add the postgreSQL jdbc jar files to your project and to the embedded WebLogic instance.
Tell us the specific error you are getting and we'll help you more.

how to connect eclipse rcp application with mysql database

I have created database and Application for my Eclipse RCP project.
now how to connect this project with MYSQL database.
if i am trying to connect it is giving error "class not found".
You can use a JPA provider with support for OSGi bundlers as http://www.eclipse.org/eclipselink/downloads/.
OR
Create a plugin from JDBC driver (plugin from exists jar) and set it as dependent of your applicantion. With this you can to acess the driver class (check OSGi bundle dependency for more details)
The same question has been asked by a user :-
Follow the link
Connecting RCP to database
How to connect to Mysql through Eclipse RCP

Creating a custom portlet application for jboss gatein with its own lucene version

I'm trying to deploy a JSR-286 portlet application that has its own lucene version (3.1) packaged in WEB-INF/lib to JBoss GateIn.
For some reason it is giving me GateIn's lucene (2.9.4) classes during runtime and its therefore producing this error:
java.lang.NoSuchFieldError: LUCENE_31
Does anyone know how to configure the portlet application and GateIn to let it load its own lucene libraries.
I could fix the error by creating a JBoss module and adding a dependency to the manifest of the war file.