jdbc model instrumentation classes

82 views
Skip to first unread message

Blind Despair

unread,
Apr 29, 2015, 3:26:09 AM4/29/15
to activejd...@googlegroups.com

I have maven project to work with database. I connected database correctly. And queries from java code are working, so I can insert new data to base or update, etc. However I need to make method to show data from tables. So I need to create class which extends Model from activejdbc.Model. This class:

import org.javalite.activejdbc.Model; import org.javalite.activejdbc.annotations.Table; @Table("emp") public class emp extends Model{ static{ validatePresenceOf("empno", "ename"); } }

Whenever I'm trying to use this class in my programm it doesn't work with 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(Model.java:2801) at org.javalite.activejdbc.Model.findAll(Model.java:2386) at Program.main(Program.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

I've no idea how to fix that. I've wasted so much time to google but didn't find anything useful. Help me please. Also I don't need to use cmd or jar. What should I just add to project? If I should use maven plugin so how to do it in my case?

Igor Polevoy

unread,
Apr 29, 2015, 3:47:21 PM4/29/15
to activejd...@googlegroups.com
Have you looked at this: http://javalite.io/instrumentation
That page has links to working examples with Maven, Ant and one without either 
Reply all
Reply to author
Forward
0 new messages