Jaspersoft Studio: org/postgresql/Driver Unsupported major.minor version 51.0

0

I am trying to get Jaspersoft Studio up and running and connecting to a local PostgreSQL database. My Java version is 1.7.0_45, and I'm on a Mac running OS X 10.9.1. 

I have tried to make a new adapter, but no matter what I try it doesn't seem to want to work. I have included a .jar file for the PostgreSQL driver, but it's either not picking it up or it wants something different. I know that the .jar file I'm including works to get a connection to the local database, because on other projects I've used the .jar and get a connection and insert records into the table. No matter what I do here though, either in the Eclipse plugin or in the standalone Jaspersoft Studio download, I am not able to get that database connection.

Any suggestions?

 

Thanks!

preston.j.lamb's picture
Joined: Feb 18 2014 - 11:18am
Last seen: 5 years 4 months ago

So that everyone else knows without having to read the other question(s). I am including the .jar file during the definition of the data adapter under the Driver Classpath tab. This is the error I get when I test the connection:

 

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)
at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.getConnection(JdbcDataAdapterService.java:145)
at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.contributeParameters(JdbcDataAdapterService.java:128)
at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:129)
at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.run(AbstractDataAdapterWizard.java:163)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
 
preston.j.lamb - 5 years 4 months ago

2 Answers:

1

Hi, 
did you already tried to connect to the PostgreSQL db without speciifying the driver?
Studio already contains a driver for that.

Regards,
Massimo.

mrabbi's picture
6790
Joined: Oct 31 2011 - 9:20am
Last seen: 16 hours 12 min ago

The first time I made a data adapter without including it I don't think it worked, so I moved on to including that .jar file. This time when I went back to try without the driver, it worked. I'm not sure why, but it did. Thanks for the answer!

preston.j.lamb - 5 years 4 months ago
0

Where are you specifying the driver? Are you using the driver tab during the adapter definition? What's the error message in the console?

hozawa's picture
44169
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 month 5 days ago

I am using the driver tab during the adapter definition to included the .jar file, and this is the error I get when trying to test that connection:

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)
at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.getConnection(JdbcDataAdapterService.java:145)
at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.contributeParameters(JdbcDataAdapterService.java:128)
at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:129)
at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.run(AbstractDataAdapterWizard.java:163)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

preston.j.lamb - 5 years 4 months ago
Feedback
randomness