Quantcast

JDBC Connection Issue

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JDBC Connection Issue

mmarino
This post has NOT been accepted by the mailing list yet.
I am attempting to connect to a database to start a baseline user authentication program. I was able to use the shiro.ini to get user roles, but I'm getting an error when trying to run the program using a JDBC connection. I have tried using both the Microsoft sqljdbc42.jar and the jTDS jar file as well, with no difference in the result. Either way I get the following error:

[ERROR] No plugin found for prefix 'java' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\mainuser.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

I've seen a couple of different troubleshooting questions for "No plugin found for prefix" but none for 'java', so I'm at a loss as to how to proceed.

Here is my Shiro.ini file, using the jTDS jar:

[main]
ds = net.sourceforge.jtds.jdbcx.JtdsDataSource
ds.serverName = SQL5
ds.user = myUser
ds.password = myPassword
ds.databaseName = myDatabase

jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.dataSource = $ds
jdbcRealm.permissionsLookupEnabled = true
jdbcRealm.authenticationQuery = "SELECT pswd FROM Users     WHERE user = ?"
jdbcRealm.userRolesQuery = "SELECT role FROM Role WHERE user = ?"
jdbcRealm.permissionsQuery = "SELECT perm FROM Permission WHERE user = ?"

Here is my pom.xml file, using the jTDS jar:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.shiro.tutorials</groupId>
<artifactId>shiro-tutorial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>First Apache Shiro Application</name>
<packaging>jar</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
                <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
        </plugin>

   
               <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.1</version>
    </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>net.sourceforge.jtds</groupId>
        <artifactId>jtds</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-core</artifactId>
        <version>1.1.0</version>
    </dependency>
   
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.6.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>
Loading...