This time I did not try the manual install but did the automatic install
Selected JDBC and torque
setup all configs and I saw the message to edit the jforum-custom.conf file to: database.connnection.implementation = net.jforum.dao.torque.TorquePooledConnection
Both errors seem to be related to the value being used for the database.connection.pool.min config parameter. The first one is because the jforum SystemGlobal.getIntValue is documented to return a NullPointerException if the value can't be found. So I wrote my code just to trap for this error and use a default value. Obviously, it returns a different exception.
Anyway, make sure this is set to an integer number in your jforum-custom.conf file. Just to be on the safe side, don't include any spaces before or after the = sign. (Shouldn't matter but...)
On my system, I do see log message about minIdle not being supported but it does not die. Some drivers support it and some don't so I left it being set in the TorquePooledConnection.makeConfig method.
Another thing is to make sure you are using the correct common-pool jar. Version 1.2 or greater (1.2 is in the distro). You may have conflicting jars in your shared/lib or common/lib tomcat directories. If you find an older version, I suggest replacing it with the newer version. Shouldn't break any existing code and will let Torque find the latest.
You should check that there are no older version of the other jars as well (especially the common-configuration jar since it's used in initializing Torque).
Also, if you are using SQL 2000 or greater, try taking the ;TDS\=7.0 part of the connection.string. This lets you connect to Version 7.0 and generally doesn't bother 2000 or >. Removing it will make the jdbc driver use the newer version of MS TDS protocol.
FWIW, I've got about a half a dozen one line changes that have been done to fix things between since I released RC1. (None a related to this.) I'll try to get out an official 1.0 with these fixes this weekend.
If none of this works, can you post a sanitized version of your db setting and some details about JVM, TC version, MS SQL version and the like.
Well I tried you suggetions and I am still getting the same error.
MS SQL: 2000
Used RC1 of the torque code: all jars exanded correctly.
I tried removing ;TDS\=7.0 fromt he end if the database.connection.string in both files.
Changed database.connection.pool.min to 0,1, and 2
Tried adding database.connection.pool.max=10 to the torque.properties
Here is the sanitized version of jforum-custom.conf and torque.properties
Please note the extra spaces at the end of each file are not in the files on the server. Just showing up in this community.
Think I've got it figured out. There are some condition in which the Torque initialization code will throw a hard error if an initialization property is not supported. The fact that I passed on the minIdle in my initialization can trigger this... I worked with my config combination but failed in yours.
I'll get out a patched version ASAP to fix this. (Hopefully late today).
registered one user and when adding a second getting error.
java.sql.SQLException: Violation of PRIMARY KEY constraint 'jforum_users_PK'. Cannot insert duplicate key in object 'jforum_users'.
Now on the forums index page at the top between Forum Index XML and the Forum banner
Method public static net.jforum.entities.LastPostInfo net.jforum.repository.ForumRepository.getLastPostInfo(int) throws java.lang.Exception threw an exception The problematic instruction: ---------- ==> assignment: lpi=fir.getLastPostInfo(forum.id) [on line 41, column 41 in default/forum_list.htm] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: Method public static net.jforum.entities.LastPostInfo net.jforum.repository.ForumRepository.getLastPostInfo(int) throws java.lang.Exception threw an exception at freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:129) at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Assignment.accept(Assignment.java:90) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at net.jforum.JForum.service(JForum.java:198) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at net.jforum.dao.torque.TorqueForumDAO.getLastPostInfo(TorqueForumDAO.java:385) at net.jforum.dao.torque.TorqueForumDAO.getLastPostInfo(TorqueForumDAO.java:463) at net.jforum.repository.ForumRepository.getLastPostInfo(ForumRepository.java:566) at net.jforum.repository.ForumRepository.getLastPostInfo(ForumRepository.java:582) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583) at freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:111) ... 40 more
If you try to view a topic you get
An error has occurred.
For detailed error information, please see the HTML source code, and contact the forum Administrator.
OK, found the underlying cause... some of my changes to support my app's SSO component slipped into the general code. My SSO implimentation supplied the user_id and so the table was not defined as an identity field (auto increment's the key as records are added).
First thing to do is to alter the user_id column in the jforum_users table so that it is an identity field. It's easy to do via Enterprise Manager's table design screen (just go to tables, right click on the table and select "Design Table", select the user_id column and set Identity to yes, Identity Seed to 1, Identity Increment to 1.
Restart everthing. This will at least get you to the proper code. (Sorry!).
There may still be some "artifacts" in the DB that will need to be cleaned up (e.g., you may have a user with an id of 0 and related group membership, posting stuff that will need to be cleaned up). I can walk you thru this if that's the case.
Yes, the public version will have this in the schema creation sql scripts. But I still need to do a full distro build and push it out. Not a big deal but haven't had time to do this and did a quick jar rebuild to get you working.
Thanks for "beta testing" and putting up with the problems.
FWIW, As I mentioned this issue was because I've got two variations of the this DAO. My open-source contributed version and one that has been slightly modified to support tight SSO/Groups/management integration with our main application.
So the "private" DAO version has been extensively tested and is in production use on our design, staging, and external servers. But a some of the bugs that got chased out of the "private" version didn't get transferred to the "public" version.
With the public V1.0, I did a full source comparison between the two versions and reconciled the fixes. This problem was a single attribute in an XML file that slipped thru. I've gone back and double checked, so (touch wood) there should be no more private specific items. So, the public version should be as stable as our private version.
The only place that I'm only 95% sure of is that there may be a few foreign key constraint issues on some of the jForum functions we don't use a lot. When I modeled the DB in Torque's XML Schema format, I followed good DB design practice of identifying all FK relationships.
However, in testing I found a several places that jForum would delete records who's id was a FK to another record or would do an insert with a null/0 FK (and then fix it later). The solution for these was generally to remove the DB constraints from the DB schema and assume that jForum would "do the right thing" (but in some cases leave "orphaned" records behind).
There may be a few of these sort of issues left. Let me know if you run across any.
Many messages that I?ve posted are not actually being displayed by the tool. For example, the ?Announcements? forum is showing only 1 post, although the number of topics is 2. A similar thing happens with ?Reading and Posting Messages?, where 7 messages are being displayed and 9 were posted. ?User Maintenance? has 2 where 4 were posted.
cocreate2008 wrote:hi guys, would you mind give me an idea about how soon will the MS SQL version be finished?
Sorry for the delay... last week was busy and I was fighting a bad cold too
It depends on what you mean by "done". I'm running my TorqueDAO with MS SQL and V2.1.6 + some bug fixes from CVS in production. So, AFAIK, the TorqueDAO is pretty stable, especially since obiweb helped debug some of the install / code changes. (Not to say that a few don't exists).
However, the "gotcha" here, is that V2.1.6 had some bugs in it if you ran the distribution version. My install has the fixes applied that were in CVS. If you want to go this route, I can probably do a quick compare of the code and generate a bug fix "patch" (e.g., a set of complied classes that update the distribution).
The alternative is to use V2.1.7, which has a pretty well debugged set of native MS SQL DAO queries included. For various reasons, there are not a choice in the installation wizard, but you can follow the manual install and use these. This is not too complicated, just running some SQL scripts, editing the config files, and the like.
FWIW, since I don't use this so I can't assess the possible problems... but then there haven't been many posts about this not working either. [originally posted on jforum.net by monroe]
This seemed like a good quick lunch time project. So, I did some compares of my code with the 2.1.6 source in CVS. I thought I had a lot of changes but most of them turned out to be specific to what I did to tightly integrate jForum with our application.
Attached is a patch file that fixes the major bugs I found in testing my DAO (plus some minor enhancements, better error reporting). [originally posted on jforum.net by monroe]