[英]ActiveJDBC Instrumentation: Unable to instrument the model classes which are in Jar
I am using activejdbc 1.4.9. 我正在使用activejdbc 1.4.9。 I created one jar (using maven) which has two ActiveJDBC Model Classes.
我创建了一个jar(使用maven),它具有两个ActiveJDBC模型类。 I added the jar to the application.
我将罐子添加到应用程序中。 Application has three more model classes.
应用程序还有三个模型类。 When I compile and try to run the application (gradle based), activejdbc is instrumenting only 3 classes which are in application but not instrumenting the classes which are in jar.
当我编译并尝试运行应用程序(基于渐变)时,activejdbc仅检测应用程序中的3个类,而不检测jar中的类。 When I try to write the data into the two models which are in jar, It is throwing exception as
当我尝试将数据写入jar中的两个模型时,它抛出异常
org.javalite.activejdbc.DBException: Failed to retrieve metadata from DB. org.javalite.activejdbc.DBException:无法从数据库检索元数据。 Are you sure table exists in DB ?
您确定数据库中存在表吗?
Now I have certain doubts. 现在我有一些疑问。 Please help me to resolve and understand few things.
请帮助我解决和了解几件事。
It is throwing this error in case classes have not been instrumented. 如果未检测类,则会引发此错误。 This means that before placing your model classes into a jar file, you need to instrument them.
这意味着在将模型类放入jar文件之前,需要对其进行检测。 Does not matter which build method you use though.
不管使用哪种构建方法都没有关系。 This http://javalite.io/instrumentation explains what is instrumentation and how to do it.
此http://javalite.io/instrumentation解释了什么是工具以及如何执行。 Instrumentation does not create jars, it merely adds some byte code into your classes.
检测不会创建jar,而只是将一些字节代码添加到您的类中。 In all scenarios you need:
在所有情况下,您都需要:
after this, you can do any of the following: 之后,您可以执行以下任一操作:
making sense? 有道理?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.