Jul 8, 2011

phpBB (SOLVED): "Access to the Administration Control Panel is not allowed as you do not have administrative permissions."

I was installing and configuring a phpBB forum today and very often I got to see  "Access to the Administration Control Panel is not allowed as you do not have administrative permissions.". I was wondering as to why I get into this error often. When I surfed the Internet, I was able to see that many who got this error ended up in a reinstall of the entire forum!!! Are you getting into the error "Access to the Administration Control Panel is not allowed as you do not have administrative permissions."

But as far as my knowledge goes, this is just an error when your session expires. Just relogin and things should start working!

Mar 1, 2011

Resolved NoSuchMethodError: org.apache.commons.beanutils.PropertyUtils.isWriteable

When I was working with the spring date comparison tool integration with spring today, I came across a wierd issue. Though I had all necessary configurations in, I confronted the following error

java.lang.NoSuchMethodError: org.apache.commons.beanutils.PropertyUtils.isWriteable(Ljava/lang/Object;Ljava/lang/String;)Z
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchMethodError: org.apache.commons.beanutils.PropertyUtils.isWriteable(Ljava/lang/Object;Ljava/lang/String;)Z
at org.apache.velocity.tools.ToolInfo.setProperty(ToolInfo.java:346)
at org.apache.velocity.tools.ToolInfo.configure(ToolInfo.java:251)
at org.apache.velocity.tools.ToolInfo.create(ToolInfo.java:232)
at org.apache.velocity.tools.Toolbox.getFromInfo(Toolbox.java:137)
at org.apache.velocity.tools.Toolbox.get(Toolbox.java:97)
at org.apache.velocity.tools.ToolContext.findTool(ToolContext.java:150)
at org.apache.velocity.tools.view.ViewToolContext.get(ViewToolContext.java:168)
at org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAdapterImpl.java:286)
at org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTReference.java:829)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:212)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at org.springframework.web.servlet.view.velocity.VelocityView.mergeTemplate(VelocityView.java:517)
at org.springframework.web.servlet.view.velocity.VelocityView.doRender(VelocityView.java:462)
at org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:291)
at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
... 17 more


I was wondering what the issue could be. It took me a few minutes to hit the target.

This is for those of you who are confronting the problem like me. Just take the solution from here rather than wasting your time in further exploration

The actual solution was to replace the commons-beanutils.jar with the latest one. I was using commons-beanutils-1.5.jar. And I replaced it with commons-beanutils-core-1.7.0.jar.

Things started working wonderfully!As always, I appreciate your feedback/hollers regarding this article any time!

Jan 21, 2011

How To Run Sql Script Files from Unix Prompt?

I had a requirement where in I had to update huge text content in the database. While writing a groovy script had always been a solution, I was looking at something that could be even simpler than that. We had always had the habit of using groovy scripts to make updates to the database. But I was wondering whether there would be some simpler solution via which I would be able to make the update just by using SQL queries at the prompt rather than spending time in writing groovy scripts, even if they be simple ones.

I explored a bit and came with the following solution. This was pretty simple and I was able to make the update within minutes. So, I thought I would share this with you. Whil some of you are awre of it, I sensed that there are a bunch of those, like me, who are indeed unaware of making large bunch of text content updates to the database.

To run SQL script files at the unix prompt, just do the following

  • Type your queries, however big they be, in a text file. Let us say that we have a file sample.sql with an update query that is going to update the database column containing text data. Let us say that this text data contains HTML tags in it. So, typing this query as such at the psql prompt is going to be challenging. Copy pasting the query is again not possible because that is going to screw up the content that gets updated in the database. Save this sample file in your local machine.
  • Create an ssh session to the remote server. Move this sample.sql file to the home directory in the remote server.
  • Goto the remote server UNIX prompt and cd to your home directory to where you have the sample.sql file. Use psql command to get into PSQL prompt. You might be using the following command to get into the PSQL prompt
    • [user@server folder]psql -h <host name>
  • You might be asked for the password here. Type the correct password and you would be directed to the psql prompt from here.
  • Once you get there, Type the following command to run the SQL script file sample.sql
    • [user@server folder][databasename=>]\i <file name>
  • And in this case it would be
    • [user@server folder][databasename=>]\i sample.sql
  • You would now get the confirmation stating
    • UPDATE 1
  • And that's it! You are done. You have made a large content update to the database in a minute!