Can't setup instrumentation Intellij IDEA Community

84 views
Skip to first unread message

_k-

unread,
Nov 8, 2014, 5:22:44 PM11/8/14
to activejd...@googlegroups.com
Hey,

I'm trying to setup ActiveJDBC instrumentation in Intellij IDEA, but although I performed all of the steps from the instruction, I can't get it to work.

In my pom.xml I have the plugin enabled:

<build>
        <plugins>
            <plugin>
                <groupId>org.javalite</groupId>
                <artifactId>activejdbc-instrumentation</artifactId>
                <version>1.4.9</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


Then I have created two tryout models that correspond with tables in my database: Client (to table "clients") and SiteUrl (to table "site_urls").

I have also enabled instrumentation as Maven goal after Make in default configuration for JUnit. Actually, it seems it runs fine:
**************************** START INSTRUMENTATION ****************************
Directory: /home/k-/Idea Projects/project/project/target/classes
**************************** END INSTRUMENTATION ****************************
**************************** START INSTRUMENTATION ****************************
Directory: /home/k-/Idea Projects/
project/project/target/test-classes
Found model:
package.persistance.Client
Found model:
package.persistance.SiteUrl
Instrumented class:
package.persistance.Client in directory: /home/k-/Idea%20Projects/project/project/target/classes/
Instrumented class: package.persistance.SiteUrl in directory: /home/k-/Idea%20Projects/project/project/target/test-classes/
**************************** END INSTRUMENTATION ****************************


But when I try to execute the following code, I get error:
public class FirstTests
{
    @Test
    public void saveTest() {
        Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://127.0.0.1/test_db", "root", "");
        Assert.assertTrue(Base.hasConnection());

        Client c = new Client();
        c.set("name", "client 1");
        c.saveIt();
    }
}


The error is:
org.javalite.activejdbc.DBException: failed to determine Model class name, are you sure models have been instrumented?

I can't figure out what might be wrong and how could I go about fixing it?

_k-

unread,
Nov 8, 2014, 5:24:15 PM11/8/14
to activejd...@googlegroups.com
My mistake, of course the instrumentation log reads:
Instrumented class: package.persistance.Client in directory: /home/k-/Idea%20Projects/project/project/target/test-classes/
Instrumented class: package.persistance.SiteUrl in directory: /home/k-/Idea%20Projects/project/project/target/test-classes/


instead of:

Instrumented class: package.persistance.Client in directory: /home/k-/Idea%20Projects/project/project/target/classes/
Instrumented class: package.persistance.SiteUrl in directory: /home/k-/Idea%20Projects/project/project/target/test-classes/


Igor Polevoy

unread,
Nov 8, 2014, 8:39:02 PM11/8/14
to activejd...@googlegroups.com
Hi, it seems you posted the same question here and on Stackoverflow. 


thanks
Reply all
Reply to author
Forward
0 new messages