Thursday, February 26, 2009

TinyMCE java spellchecker

I was looking everywhere to find a spellchecker that was java for TinyMCE.... I figured it was needed since I had a Java web app running on tomcat. But! Then I found an article asking why convert.... Apache allows both java and php on the same site. In order to allow my hosting provider to recognize the php pages within my j2ee app I added the following lines:

SetEnvIf Request_URI \.php no-jk
SetEnvIf Request_URI \.cgi no-jk
to my web settings. Then it worked like a charm! So... I know this isn't a solution for those of you looking for a java spellchecker... but it was a solution that worked for me.

TinyMCE relative path IMG problem

I've been using TinyMCE as a WYSIWYG editor on my website www.puppages.com. I absolutely LOVE it. There was one issue that was a little frustrating. When someone tried to link back to another page on the site (or an image/document on the site), the TinyMCE code would convert the absolute path into a relative path and the relative path would not work. I was able to fix this by doign some javascript editing.

Here's the solution:
  1. Open the tiny_mce.js file.
  2. Find all references to the function: toRelative(u)
  3. replace with return u
  4. save

Sunday, February 22, 2009

Scriptalicious Tree is null or not an object line 935 - Internet Explorer only

For some reason my scriptalicious ajax code works beautifully for dragging and dropping in firefox but when it comes to Internet Explorer I'm getting a weird error:

'tree' is null or not an object at line 935Here's line 935: if (options.tree) {

I'm still trying to figure out what is going on...

**** fixed it. The problem was I had another element on the page with a name="x" and my draggable item had id="x". So since there was a conflict the error occurred.

Solution: Check to see if the id is unique (also not used as a name value).

Friday, February 20, 2009

Another weird tomcat error

Works locally on WAS but when installed on tomcat I get the following error when accessing a jsp page:

INFO | jvm 1 | 2009/02/20 16:16:32 | org.apache.jasper.JasperException: /gensetup.jsp(17,4) Expecting "jsp:param" standard action with "name" and "value" attributes
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parseParam(Parser.java:827)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1665)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1004)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parseInclude(Parser.java:856)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1118)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1448)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Parser.parse(Parser.java:133)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
INFO | jvm 1 | 2009/02/20 16:16:32 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
INFO | jvm 1 | 2009/02/20 16:16:32 | at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
INFO | jvm 1 | 2009/02/20 16:16:32 | at java.lang.Thread.run(Thread.java:619)


The problem was i had a scriptlet to print out a message during test:

<% System.out.println("message"); %>



so after removing that print statement it worked just fine.

Thursday, February 19, 2009

404 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) error

I was seeing the weirdest error when I tested some of my jsp code on my server after doing some updates locally and then deploying the same files to the server that worked locally. At first I thought it had something to do with the hosting server being tomcat and my local server being IBM WAS. Turns out WAS let me run a servlet that returned to:

myJsp.jsp

when the real name of the file was: myjsp.jsp (no capital J).

So when I went to test the "working" code on my hosted tomcat server I got a 404 error:
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

All it was was a capitalization error. But it was a hard one to debug since I had no idea what it was referring to.