title: ClassNotFoundException when ORMLite tries to create database table with an image on android
body: <p>Hi I am using ORMLite for database access. After I add a table with an image it crashes with a <code>ClassNotFoundException</code>.</p>
  
  <pre><code>@DatabaseField (dataType = DataType.SERIALIZABLE)
  private Image image;
  </code></pre>
  
  <p>The following error occured in the <em>onCreate</em> method of the subclass of <em>OrmLiteSqliteOpenHelper</em>.</p>
  
  <pre><code>01-09 14:45:51.108: W/dalvikvm(1897): Unable to match class for part: 'Landroid/media/Image;'
  01-09 14:45:51.118: W/dalvikvm(1897): threadid=12: thread exiting with uncaught exception (group=0x40a13300)
  01-09 14:45:51.198: E/AndroidRuntime(1897): FATAL EXCEPTION: AsyncTask #1
  01-09 14:45:51.198: E/AndroidRuntime(1897): java.lang.RuntimeException: An error occured while executing doInBackground()
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.lang.Thread.run(Thread.java:856)
  01-09 14:45:51.198: E/AndroidRuntime(1897): Caused by: java.lang.NoClassDefFoundError: android/media/Image
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.lang.Class.getDeclaredFields(Native Method)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.lang.Class.getDeclaredFields(Class.java:647)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.android.DatabaseTableConfigUtil.fromClass(DatabaseTableConfigUtil.java:49)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.db.SqliteAndroidDatabaseType.extractDatabaseTableConfig(SqliteAndroidDatabaseType.java:76)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.dao.DaoManager.createDao(DaoManager.java:67)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.table.TableUtils.createTable(TableUtils.java:218)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.table.TableUtils.createTable(TableUtils.java:53)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.example.test.ECDatabaseHelper.onCreate(ECDatabaseHelper.java:84)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.onCreate(OrmLiteSqliteOpenHelper.java:207)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.android.AndroidConnectionSource.getReadWriteConnection(AndroidConnectionSource.java:63)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.android.AndroidConnectionSource.getReadOnlyConnection(AndroidConnectionSource.java:51)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.j256.ormlite.dao.BaseDaoImpl.queryForFirst(BaseDaoImpl.java:229)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.example.test.ECDatabaseHelper.getLastUpdateStations(ECDatabaseHelper.java:218)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.example.test.ECConnect.doUpdate(ECConnect.java:170)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.example.test.ECConnect$UpdateTask.doInBackground(ECConnect.java:109)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at com.example.test.ECConnect$UpdateTask.doInBackground(ECConnect.java:1)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     ... 5 more
  01-09 14:45:51.198: E/AndroidRuntime(1897): Caused by: java.lang.ClassNotFoundException: android.media.Image
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  01-09 14:45:51.198: E/AndroidRuntime(1897):     ... 25 more
  </code></pre>
  
  <p>Can someone help me out? I tried ORMLite 4.48 and 4.47.</p>
  
  <p>add <code>ECDatabaseHelper</code>:</p>
  
  <pre><code>public class ECDatabaseHelper extends OrmLiteSqliteOpenHelper    {
  
      private final String LOG_TAG = getClass().getSimpleName();
      private static final String DATABASE_NAME = "test.db";
      private static final int DATABASE_VERSION = 1;
      private static ECDatabaseHelper  instance = null;
  
      private Dao&lt;Station, Integer&gt; stationDao = null;
      private Dao&lt;Service, Integer&gt; serviceDao = null;
  
      public static synchronized ECDatabaseHelper getHelper(Context context) {
          Log.i("ECDatabase", "getHelper");
          if (instance == null) {
              instance = new ECDatabaseHelper(context);
          }
          return instance;
      }
  
      private ECDatabaseHelper(Context context) {
          super(context.getApplicationContext(), DATABASE_NAME, null, DATABASE_VERSION);
          Log.i("ECDatabase", "ECDatabaseHelper () - constructor");
      }
  
      @Override
      public void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {
              try {
                      Log.i(ECDatabaseHelper.class.getName(), "onCreate");
                      TableUtils.createTable(connectionSource, Station.class);
                      Log.i(ECDatabaseHelper.class.getName(), "table station created");
                      TableUtils.createTable(connectionSource, Service.class);
                      Log.i(ECDatabaseHelper.class.getName(), "table service created");
              } catch (SQLException e) {
                      Log.e(ECDatabaseHelper.class.getName(), "Can't create database", e);
                      throw new RuntimeException(e);
              }
  
      }
  </code></pre>