Please use the google group to ask questions - thanks.

by Fabrice Esti����venart 22 Mar 15:01
IllegalArgumentException: No enum const class

Hello,

I'm trying the "CheckDataSource" example with a PGSQL database and I get the following exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
at CheckDataSource.main(CheckDataSource.java:12)
Caused by: java.lang.IllegalArgumentException: No enum const class com.avaje.ebean.AdminLogging$LogLevelStmt.SQL
at java.lang.Enum.valueOf(Enum.java:196)

Could you please help me ? Thanks,

Fabrice

22 Mar 21:06
by Rob

Sure. Where is the CheckDataSource example?

23 Mar 08:08
by Fabrice Esti����venart

In the "Getting started" section of this site: http://www.avaje.org/ebean/getstarted_props.html

24 Mar 00:59
by Rob

Thanks.

Ok, I didn't see anything wrong in that page.

Can you show the full stack trace of the error?

The error you are getting looks like one of the properties in the ebean.properties file is not correct (or that the value is incompatible with the version of Ebean you are using).

So, if you post up the full stack trace and the Ebean version you are using then that will likely point to the issue.

Thanks, Rob.

26 Apr 19:41
by manhha

Hi Rob,
I have same problem with Fabric when i tried the example CheckDataSource above. This is full stack trace that i received from Eclipse:
Apr 27, 2010 2:30:00 AM com.avaje.ebean.Ebean
INFO: Ebean Version[2.5.1] Java Version[1.6.0_18]
Apr 27, 2010 2:30:00 AM com.avaje.ebeaninternal.server.core.BootupClassPathSearch search
INFO: Classpath search hits in jars[ebean-2.5.1.jar] pkgs[com.avaje.ebeaninternal.server.bean, com.avaje.ebean.meta] searchTime[78]
Exception in thread "main" java.lang.ExceptionInInitializerError
at CheckDataSource.main(CheckDataSource.java:8)
Caused by: java.lang.NullPointerException
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getHeartbeatSql(DefaultServerFactory.java:399)
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getDataSourceFromConfig(DefaultServerFactory.java:388)
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.setDataSource(DefaultServerFactory.java:353)
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:148)
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:121)
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:67)
at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:63)
at com.avaje.ebean.Ebean$ServerManager.getWithCreate(Ebean.java:236)
at com.avaje.ebean.Ebean$ServerManager.(Ebean.java:192)
at com.avaje.ebean.Ebean$ServerManager.(Ebean.java:158)
at com.avaje.ebean.Ebean.(Ebean.java:152)
... 1 more

I use Ebean 2.5.1

Can you help me? Thank you.
Can you help me? Thank you.

03 May 22:47
by Rob

Note that your problem is not the same - you are getting a different error (NPE at DefaultServerFactory.java:399).

So it looks to me like there is not a jdbc driver specified. So you need to check your ebean.properties file. Perhaps you are missing the databaseDriver entry?


# example

datasource.h2.username=sa
datasource.h2.password=
datasource.h2.databaseUrl=jdbc:h2:mem:tests;DB_CLOSE_DELAY=-1
datasource.h2.databaseDriver=org.h2.Driver
datasource.h2.minConnections=1
datasource.h2.maxConnections=25
datasource.h2.heartbeatsql=select 1
datasource.h2.isolationlevel=read_committed

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse