Add new attachment

Only authorized users are allowed to upload new attachments.

This page (revision-23) was last changed on 24-Sep-2009 18:53 by 213.252.50.50  

This page was created on 17-Dec-2005 05:59 by MyTestUser

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 51 changed one line
In this example, I used a JBoss HSQLDB service to create a simple relational database. The first thing be done is to create the database service in JBoss. This is achieved through the following entries in conf/hsqldb-ds.xml:
In this example, I used a JBoss HSQLDB service to create a simple relational database. The first thing be done is to create the database service in JBoss. This is achieved through the following entries in __deploy/hsqldb-ds.xml__
At line 56 removed one line
At line 66 changed 4 lines
<metadata>
<type-mapping>Hypersonic SQL</type-mapping>
</metadata>
<depends>jboss:service=Hypersonic</depends>
<depends>jboss:service=Hypersonic,database=UserDB</depends>
At line 73 changed one line
name="jboss:service=Hypersonic">
name="jboss:service=Hypersonic,database=UserDB">
At line 81 removed one line
At line 81 added 118 lines
Now create the database structure using this script:
{{{
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE USERS(USERID VARCHAR(32) NOT NULL PRIMARY KEY,PASSWD VARCHAR(32) NOT NULL,EMAIL VARCHAR(64),CREATED TIMESTAMP,MODIFIED TIMESTAMP,FIRSTNAME VARCHAR(20),LASTNAME VARCHAR(20),FULLNAME VARCHAR(50),WIKINAME VARCHAR(50),ISGROUP BOOLEAN DEFAULT false NOT NULL)
CREATE MEMORY TABLE ROLES(USERID VARCHAR(32) NOT NULL,ROLEID VARCHAR(32) NOT NULL,PRIMARY KEY(USERID,ROLEID),CONSTRAINT FK_USERS FOREIGN KEY(USERID) REFERENCES USERS(USERID))
CREATE MEMORY TABLE GROUPMEMBERS(USERID VARCHAR(32) NOT NULL,GROUPID VARCHAR(32) NOT NULL,CONSTRAINT FK_GRPMEM_USERS FOREIGN KEY(USERID) REFERENCES USERS(USERID),CONSTRAINT FK_GRPMEM_GROUPS FOREIGN KEY(GROUPID) REFERENCES USERS(USERID))
CREATE VIEW V_ROLES (USERID,GROUPID,ROLEID) AS select USERID,GM.GROUPID,ROLEID\u000d\u000afrom GROUPMEMBERS AS GM \u000d\u000ainner join ROLES on GM.GROUPID=ROLES.USERID\u000d\u000aunion \u000d\u000aselect USERID,null, ROLEID\u000d\u000afrom USERS\u000d\u000ainner join ROLES on USERS.USERID=ROLES.USERID\u000d\u000awhere USERS.ISGROUP=FALSE
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 20
}}}
This structure allows for users, groups and roles. Roles can be assigned to either groups or users, and users can me made members of zero or more groups. The view V_ROLES is used to enumerate all the roles that a user possesses, either directly, or indirectly through group membership. A group is defined in the USERS table with the value of ISGROUP set to true. Note that while it is possible to make a group a member of another group, the view is not recursive; it will only deliver the roles up to the first level of group membership.
The next task is to change the default JBoss security authentication to use this database. These settings are held in __conf/login-config.xml__.
{{{
<policy>
<!-- The default login configuration used by any security domain that
does not have a application-policy entry with a matching name
-->
<application-policy name = "other">
<authentication>
<login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
flag = "required">
<module-option name = "unauthenticatedIdentity">guest</module-option>
<module-option name = "dsJndiName">java:/UserDS</module-option>
<module-option name = "principalsQuery">SELECT PASSWD FROM USERS WHERE USERID=? AND ISGROUP=FALSE</module-option>
<module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM V_ROLES WHERE USERID=?</module-option>
</login-module>
</authentication>
</application-policy>
<application-policy name="JSPWiki-container">
<authentication>
<login-module code="com.ecyrd.jspwiki.auth.login.WebContainerLoginModule"
flag="sufficient"/>
<login-module code="com.ecyrd.jspwiki.auth.login.CookieAssertionLoginModule"
flag="sufficient"/>
<login-module code="com.ecyrd.jspwiki.auth.login.AnonymousLoginModule"
flag="sufficient"/>
</authentication>
</application-policy>
}}}
Whilst this is enough for JBoss authentication, a few more settings are needed for JSPWiki to be able to integrate its profile maintenance in the same database. Firstly, in __deploy/JSPWiki.war/WEB-INF/web.xml__ ensure the following lines are present:
{{{
<resource-ref>
<description>
Resource reference to JNDI factory for the JDBCUserDatabase.
</description>
<res-ref-name>
jdbc/UserDS
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
}}}
Note that the name of the data source is arbitrary, but it must match the datasource name defined in jspwiki.properties. (NB: The name I used here is not the default that comes in the JSPWiki distribution).
Also required in the same folder is a __jboss-web.xml__ file. This completes the jndi name lookup linkage. This creates a linkage between the datasource name used above, and the jndi datasource named used in hsqldb-ds.xml. The file looks like this:
{{{
<?xml version="1.0" encoding="ISO-8859-1"?>
<jboss-web>
<resource-ref>
<res-ref-name>
jdbc/UserDS
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<jndi-name>
java:UserDS
</jndi-name>
</resource-ref>
</jboss-web>
}}}
Finally, the __jspwiki.properties__ file needs these entries:
{{{
###########################################################################
#
# JDBC Configuration. Tells JSPWiki which tables and columns to map
# to for the JDBCUserDatabase. For more info, see the JavaDoc
# for class com.ecyrd.jspwiki.auth.user.JDBCUserDatabase.
#
jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.JDBCUserDatabase
jspwiki.userdatabase.datasource=jdbc/UserDS
jspwiki.userdatabase.table=USERS
jspwiki.userdatabase.email=EMAIL
jspwiki.userdatabase.fullName=FULLNAME
jspwiki.userdatabase.loginName=USERID
jspwiki.userdatabase.password=PASSWD
jspwiki.userdatabase.wikiName=WIKINAME
jspwiki.userdatabase.created=CREATED
jspwiki.userdatabase.modified=MODIFIED
}}}
Remember to comment out the other jspwiki.userdatabase property setting that specifies the use of the XML file. (Which is the default mechanism).
That's it!
Notes:
# The groups concept in the JBoss authentication database has nothing to do with JSPWiki groups. JSPWiki cannot even see these group names, although it would be rather neat if it did! (Enhancement idea!)
# It is possible to tell JBoss that the passwords are held in encrypted form in the database by adding additional settings in conf/login-config.xml. However, you must devise your own method for getting them into the database in encrypted form.
# I would really like a mechanism for users to change their own passwords when using container-based authentication, along with email based lookup of forgotten passwords and lockout after x tries.
At line 201 added 136 lines
----
Uncommenting the JAAS section in the web.xml broke logging in for me. I'm running JBoss 4.0.5GA though, so I don't know if something changed since 4.0.3 (although I doubt it). I believe it is breaking because it enables Container Managed Authentication which, unless you are doing authentication to a database or something besides the default XML database, is not needed. If someone knows why this doesn't work please let us know.
--[AndrewSerff|http://andrew.serff.net], 21-Jan-2007
I have installed JSPWiki in JBoss and use MS SQL Server 2000 Database. I configured all the properties for jdbc provider also. When i run the Install.jsp file and click configure it is showing no admin account. My database is getting initialized and the connection is getting closed by the CachedConnectionManager. Also i get that the connection handle has been closed and is unusable when i try to save a profile. Please help me out at the earliest.
--yesesnono, 19-Jul-2007
I deployed the latest version to JBoss 4.0.4. I have followed the above steps, but when I tried to navigate to login page, it failed to display the page. Anyone knows why?
----
I can confirm that JSPWiki 2.6.0 dies on JBoss 4.0.5.GA.
\\__Specs__
*JVM 1.4.1_02_Build6
*JSPWiki 2.6.0
*JBoss 4.0.5.GA.
The front page doesn't complete loading. The following exception gets thrown:
{{{
java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/common/fmt/BundleSupport
at javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(Unknown Source)
at javax.servlet.jsp.jstl.fmt.LocaleSupport.getLocalizedMessage(Unknown Source)
...
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:602)
at com.ecyrd.jspwiki.tags.ContentTag.doEndTag(ContentTag.java:126)
}}}
--Louis, 08-Oct-2008 20:28
\\P.S.
*Also occurs on JDK 1.5.0_11
*Also occurs with JSPWiki 2.6.4 Stable
--lysior@gmx.de, 24-Sep-2009:
can be solved by deploying maven-2.2.1-uber.jar and standard-1.0.3.jar from apache Maven project
----
Oracle script:\\
\\CREATE TABLE USERS(USERID VARCHAR(32) NOT NULL PRIMARY KEY,
PASSWD VARCHAR(32) NOT NULL,
EMAIL VARCHAR(64),
CREATED TIMESTAMP,
MODIFIED TIMESTAMP,
FIRSTNAME VARCHAR(20),
LASTNAME VARCHAR(20),
FULLNAME VARCHAR(50),
WIKINAME VARCHAR(50),
ISGROUP NUMBER DEFAULT 0 NOT NULL);
\\
\\CREATE TABLE ROLES(USERID VARCHAR(32) NOT NULL,
ROLEID VARCHAR(32) NOT NULL,
PRIMARY KEY(USERID,ROLEID),
CONSTRAINT FK_USERS FOREIGN KEY(USERID) REFERENCES USERS(USERID));
\\
\\CREATE TABLE GROUPMEMBERS(USERID VARCHAR(32) NOT NULL,
GROUPID VARCHAR(32) NOT NULL,
CONSTRAINT FK_GRPMEM_USERS FOREIGN KEY(USERID) REFERENCES USERS(USERID),
CONSTRAINT FK_GRPMEM_GROUPS FOREIGN KEY(GROUPID) REFERENCES USERS(USERID));
\\
\\CREATE VIEW V_ROLES (USERID,GROUPID,ROLEID) AS select gm.USERID, gm.GROUPID, r.ROLEID
from GROUPMEMBERS gm
inner join ROLES r on gm.GROUPID = r.USERID
union
select u.USERID, null, r.ROLEID
from USERS u
inner join ROLES r on u.USERID = r.USERID
where u.ISGROUP=0;
--Dean Pullen, 11-Nov-2008 11:57
----
! Issue with JBOSS-5.0.0.GA and JSPWiki 2.6.4
I successfully implemented JSPWiki 2.6.4 on JBOSS 3.2.6RC2 on a Windows 2000 Server. To do so I removed log4j from JSPWiki.war as suggested earlier in this page. I was then able to deploy. I then exploded the war file as suggested and that also worked fine.
When I upgraded JBOSS to 5.0.0.GA, I was unable to deploy JSPWiki 2.6.4. When I tried to do so, I got the following errors and warnings:
{{{
WARN [SaxJBossXBParser] SchemaLocation: schemaLocation value = 'http://java.sun.com/xml/ns/j2ee/web-app-2_4.xsd' must have an event number of URI's. @ vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/JSPWiki.war/WEB-INF/web.xml[6,23]
ERROR [AbstractKernelController] error installing to Parse: name-vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/JSPWiki.war state=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creaing managed object for vfszip:C:/jboss-5.0.0.GA/server/default/deploy/JSPWiki.war
...
}}}
With the help of Harry Metske and Romano Silva, I was able to resolve this problem.
The resolution to this problem is two-fold. The web.xml in JSPWiki version 2.6.4 is not quite correct (this has already been corrected in JSPWiki 2.8) if you don't want to switch to 2.8, you can try to hack the JSPWiki JSPWiki.war/WEB-INF/web.xml file:
Change:
{{{
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
to read
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
}}}
That fixes the first problem you encounter. The second problem happens when you make the fix above. After fixing the above, you get the error:
{{{
ERROR [[/JSPWiki]] Exception starting filter WikiJSPFilter
Java.lang.LinkageError: loader constraints violated when linking
org/xml/sax/DTDHandler class
at org.jdom.input.SAXBuilder.configureParser(SAXBuilder.java:614)
...
ERROR [[/JSPWiki]] Exception starting filter WikiServletFilter
Java.lang.NoClassDefFoundError
at com.ecyrd.jspwiki.WikiEngine.initialize(WikiEngine.java:504)
...
}}}
To fix that error, use the hint found in the [BugProblemsWithCommonLogging] page:
* replace JSPWiki.war/WEB-INF/lib/commons-logging-api.jar with commons-logging-adapters-1.1.1.jar which appears in the [Apache Commons Logging site | http://commons.apache.org/downloads/download_logging.cgi]
* remove JSPWiki.war/WEB-INF/lib/xmlrpc.jar
''Note: a [web posting | http://article.gmane.org/gmane.comp.java.xdoclet.user/7798] provides the clue to above.''
--Tom Duffy, 15-May-2009 13:24
Version Date Modified Size Author Changes ... Change note
23 24-Sep-2009 18:53 17.338 kB 213.252.50.50 to previous
22 18-May-2009 16:34 17.207 kB TomDuffy to previous | to last
21 18-May-2009 16:33 17.251 kB TomDuffy to previous | to last
« This page (revision-23) was last changed on 24-Sep-2009 18:53 by 213.252.50.50