• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Expression undefined

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help!

I use JForum 2.0.2 and mysql 4.0.9 gamma with Windows XP. When I click Recent Topics link I get recent topic list. However in the middle of this list I see the message:

Expression forums.get(topic_index).getName() is undefined on line 64, column 199 in default/recent_thread.htm. The problematic instruction: ---------- ==> ${forums.get(topic_index).getName()} [on line 64, column 197 in default/recent_thread.htm] in include moduleAction [on line 71, column 21 in default/forum_base.htm] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression forums.get(topic_index).getName() is undefined on line 64, column 199 in default/recent_thread.htm. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at freemarker.core.Expression.getStringValue(Expression.java:118) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:171) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:171) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at freemarker.core.Environment.visit(Environment.java:284) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:171) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:171) at freemarker.core.Environment.include(Environment.java:1256) at freemarker.core.Include.accept(Include.java:156) at freemarker.core.Environment.visit(Environment.java:171) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:171) at freemarker.core.Environment.process(Environment.java:156) at freemarker.template.Template.process(Template.java:219) at net.jforum.JForum.service(JForum.java:273) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644) at java.lang.Thread.run(Thread.java:595)

This message is in the Forum Name column and all other columns in this line are empty. Before this line and after it I see some normal lines with topics description.


After the end of topics list I see Information box with the message:

freemaker.core.InvalidReferenceException: Expression forums.get(topic_index).getName() is undefined on line 64, column 199 in default/recent_thread.htm

My database was created with JForum 2.0.1 and I got this effect. Then I've replaced to JForum 2.0.2, but I have the same result.

What should I do ? :?:

One more question: is there simple method to change forum's colors, fonts, logo, etc ? :?: Where can I read it ? :?:
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm.. I'm not sure why this error occurs? it happens only in the "Recent Topics" page? There are already Categories and Forums created ( ok, may sound a silly question, but I need to ask it anyway ;) ).

You can change fonts, colors and styles in general by editing the file "templates/default/style.css"

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael, I'm afraid it is not true.

You are right in that after a forum deletion links to it still present in database.
However, I used only standard JForum admins's possibilities.

I repeated this situation: as admin I created new forum, then created some new topics in it, then removed this new forum.
Result: I still see these new topics in database.

So, I can assume: probably JForum users have never deleted forums populated with topics.
Possibly, it is actual for mysql only.
If I'm right I hope this problem with database integrity is not too hard to fix.


I have the next question: how can I create new forum programmatically ?
For example, if my application has description info for some companies and it is desirable to create company's forum or category with forum automatically after new company creation.
Is it possible ?
[originally posted on jforum.net by mishelk]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mishelk wrote:Rafael, I'm afraid it is not true.

You are right in that after a forum deletion links to it still present in database.
However, I used only standard JForum admins's possibilities.

I repeated this situation: as admin I created new forum, then created some new topics in it, then removed this new forum.
Result: I still see these new topics in database.



Ok, so that's a bug in jforum.

mishelk wrote:
I have the next question: how can I create new forum programmatically ?
For example, if my application has description info for some companies and it is desirable to create company's forum or category with forum automatically after new company creation.
Is it possible ?



Yes, just add it to the table. However, as forums are cached in memory, you'll need to refresh the cache, by calling



Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael, I've sent to you more detailed info about problem and mysql database image - I hope it will be helpful
[originally posted on jforum.net by mishelk]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael,

I received your email. Do you removed a forum directly in the mysql console? The problem occurs because there are some topics ( records in jforum_topics and related ) which have the "forum_id" equals to "1", but there is not anymore a forum with this id.

This assumption is true? If so, you should remove the records from jforum_topics and jforum_posts that points to this inexistent forum.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael, let me describe my temporary solution to avoid this bug

1. I added the next snippet of code:

FOREIGN KEY (forum_id)
REFERENCES jforum_forums (forum_id)
ON DELETE CASCADE

into all tables using forum_id field, i.e. jforum_posts,
jforum_topics, jforum_search_topics. This step ensures deletion
suitable topics from database after forum deletion

2. Because forum deletion from ForumRepository doesn't enforce
this forum's topics deletion from TopicsRepository, so I had to set
topic.cache.enabled = false in SystemGlobals.properties file

Draw attention, please, forum_id field in mysql_db_struct.sql
has smallint(5) type in jforum_forums and jforum_posts tables, but
smallint(8) type in jforum_topics and jforum_search_topics tables.
Is it correct ?

The next my note about hyperlinks. If I install forum at address
http://www.mycompany.com:8080/forum, when I point mouse pointer to logo I see "http://www.mycompany.com:8080/forum/forums/list.page" link, i.e. link to forum's homepage. However, when I point to "Back to home page" link I see "http://localhost:8080/forum" link. If I press this link I get "HTTP Status 503 - This application is not currently available" error.
I suppose it is a bug.
[originally posted on jforum.net by mishelk]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mishelk wrote:Rafael, let me describe my temporary solution to avoid this bug

1. I added the next snippet of code:

FOREIGN KEY (forum_id)
REFERENCES jforum_forums (forum_id)
ON DELETE CASCADE

into all tables using forum_id field, i.e. jforum_posts,
jforum_topics, jforum_search_topics. This step ensures deletion
suitable topics from database after forum deletion



The code in the CVS has this bug fixed, using a different approach. In the first jforum's versions the mysql tables were using constraints and a more elaborated design, but due to some stupid mysql's behaviour, I rolled back to the current implementation and did many checkings ih the java code.

mishelk wrote:
Draw attention, please, forum_id field in mysql_db_struct.sql
has smallint(5) type in jforum_forums and jforum_posts tables, but
smallint(8) type in jforum_topics and jforum_search_topics tables.
Is it correct ?



Ops, going to fix it. Thanks.

mishelk wrote:
The next my note about hyperlinks. If I install forum at address
http://www.mycompany.com:8080/forum, when I point mouse pointer to logo I see "http://www.mycompany.com:8080/forum/forums/list.page" link, i.e. link to forum's homepage. However, when I point to "Back to home page" link I see "http://localhost:8080/forum" link. If I press this link I get "HTTP Status 503 - This application is not currently available" error.
I suppose it is a bug.



You should properly set the value of the key "forum.link" at SystemGlobals.properties.

Rafael
[originally posted on jforum.net by Rafael Steil]
reply
    Bookmark Topic Watch Topic
  • New Topic