Realm Connection

20 views
Skip to first unread message

Jean-Marc INIKO

unread,
Apr 29, 2021, 6:52:08 PM4/29/21
to web4j-users
Hello there, Bonjour les amis!
First and foremost kudos to this fantastic work
I am slowly learning web4j that is uncommon in the verbose xmlspringyfied world.
I am facing a pb when connecting on fish demo or predictions.
I can not log in though the db is correctly configured in server.xml and context.xml.
I am running out of hints;
I can e.g create a new user in predictions (so it is not a DB problem) but can not connect.
The same happens in fish demo. So I suspect it is due to realm.
I am on ubuntu, tomcat 8.5.
Thanks
-----------------------------------------------part of server.xml for fishdemo---------------------------------
<Realm 
  className="org.apache.catalina.realm.JDBCRealm" 
  connectionURL="jdbc:mysql://localhost:3306/fish_access?user=root&amp;password=admin"
  digest="SHA-1"
  driverName="com.mysql.cj.jdbc.Driver"
  roleNameCol="Role"
  userCredCol="Password" 
  userNameCol="UserName" 
  userRoleTable="UserRole" 
  userTable="Users"
  datesourceName="jdbc/fish_access"
  connectionName="root"
  connectionPassword="admin"
  debug="99"
  />
-------------------------------------------------------------------------------------

and here is part of context.xml

 <Resource 
   name="jdbc/fish" 
   auth="Container" 
   type="javax.sql.DataSource" 
   username="root"
   password="admin"
   driverClassName="com.mysql.cj.jdbc.Driver"
   url="jdbc:mysql://localhost:3306/fish?useServerPrepStmts=false"
   maxActive="10"
   maxIdle="5"
 />
 <Resource 
   name="jdbc/fish_translation" 
   auth="Container" 
   type="javax.sql.DataSource" 
   username="root"
   password="admin"
   driverClassName="com.mysql.cj.jdbc.Driver"
   url="jdbc:mysql://localhost:3306/fish_translation"
   maxActive="10"
   maxIdle="5"
 />
 <Resource 
   name="jdbc/fish_access" 
   auth="Container" 
   type="javax.sql.DataSource" 
   username="root"
   password="admin"
   driverClassName="com.mysql.cj.jdbc.Driver"
   url="jdbc:mysql://localhost:3306/fish_access"
   maxActive="10"
   maxIdle="5"
 />
 




John O'Hanley

unread,
Apr 29, 2021, 6:53:38 PM4/29/21
to web4j-users
Hello,

Yes, such problems are almost always a wrong setting in the config: context file name, file location, missing database jar, bad setting....

You can check the application logs upon startup as well.

BUT, I wouldn't really recommend building new things with web4j. It's old. It isn't being maintained.
The newer tools have their defects, but they also have a lot of advantages. 

- John 
Reply all
Reply to author
Forward
0 new messages