Instrument Classes Model Jdbc

I have a maven project to work with a database. I have connected the database correctly. And queries from java code work, so I can insert new data into the database or update etc. However, I need to make a method to display data from tables. So I need to create a class that extends Model from activejdbc.Model. This class:

import org.javalite.activejdbc.Model;
import org.javalite.activejdbc.annotations.Table;

public class emp extends Model{
        validatePresenceOf("empno", "ename");



Whenever I try to use this class in my program, it fails with an exception:

Exception in thread "main" org.javalite.activejdbc.InitException: failed to determine Model class name, are you sure models have been instrumented?
    at org.javalite.activejdbc.Model.getDaClass(
    at org.javalite.activejdbc.Model.findAll(
    at Program.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.intellij.rt.execution.application.AppMain.main(


I don't know how to fix this. I've spent so much time on google but didn't find anything useful. Help me please. Also I don't need to use cmd or jar. What should I add to the project?


source to share

1 answer

Fixed. You just need to use the "package" button in your Maven project lifecycle.



All Articles