Error when set to developmentMode in Eclipse

Hi everyone,

I am new to openfire and just build my project using Eclipse 4.5.1. The source version I use is openfire_src_4_0_2.

I used files in build\eclipse\ to import the project into the IDE, then followed the build steps in

Openfire SVN + Eclipse 3.3 + Subversive Installation Guide

It works fine as I can start org.jivesoftware.openfire.starter.ServerStarter and enter http://127.0.0.1:9090/setup/index.jsp.

However when I tried to debug the .jsp and added -DdevelopmentMode=“true” to VM arguments, I got:

HTTP ERROR 500

Problem accessing /setup/index.jsp. Reason:

Server Error

Caused by:

org.apache.jasper.JasperException: Unable to compile class for JSP
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:579)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:405)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:349)
      at org.eclipse.jetty.jsp.JettyJspServlet.service(JettyJspServlet.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
      at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:76)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:53)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:80)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:162)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException
     at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:530)
      at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1428)
     at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
      at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
      at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
      ... 37 more

Caused by:

java.lang.NullPointerException
     at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:530)
      at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1428)
      at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
      at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
      at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:405)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:349)
      at org.eclipse.jetty.jsp.JettyJspServlet.service(JettyJspServlet.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
      at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:76)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:53)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:80)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:162)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      at java.lang.Thread.run(Thread.java:745)

Powered by Jetty://


I add the tools.jar into the classpath according to

https://community.igniterealtime.org/message/203527. But the problem is still occur. I wonder if I missed any instructions,

Hope someone can help me with this

This might be related and probably already fixed in the latest code branch (not 4.0.2 src) Missing libraries in Eclipse .classpath - Git Master source code

Hi wroot,

Thank you for your reply. I download the snapshot-4-20 and build it.

It fixed the outdated jars problem. However when I was starting the developement mode, the error occured again.

I realized there’s a logger mechanism. The log file attached here showing something’s wrong with org.jivesoftware.openfire.container.AdminConsolePlugin.

Any idea or suggestion how to deal with this?

2016.04.21 10:22:44 INFO [main]: org.jivesoftware.openfire.XMPPServer - Registering shutdown hook (standalone mode)

2016.04.21 10:22:45 INFO [main]: org.jivesoftware.openfire.XMPPServer - Openfire 4.1.0 Alpha [Apr 21, 2016 10:22:45 AM]

2016.04.21 10:22:45 ERROR [pool-1-thread-1]: org.jivesoftware.openfire.container.AdminConsolePlugin - An exception occurred while trying to make available the admin console via HTTPS.

java.lang.NullPointerException

at org.jivesoftware.openfire.container.AdminConsolePlugin.startup(AdminConsolePlug in.java:141)

at org.jivesoftware.openfire.container.AdminConsolePlugin.initializePlugin(AdminCo nsolePlugin.java:241)

at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :442)

at org.jivesoftware.openfire.container.PluginManager.access$1(PluginManager.java:2 69)

at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1039)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301 (ScheduledThreadPoolExecutor.java:180)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:294)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

2016.04.21 10:22:45 INFO [pool-1-thread-1]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Favicon Misses

2016.04.21 10:22:45 INFO [pool-1-thread-1]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Favicon Hits

2016.04.21 10:22:46 INFO [pool-1-thread-1]: org.jivesoftware.openfire.container.AdminConsolePlugin - Admin console listening at http://dqs-pc:9090

2016.04.21 10:22:46 INFO [pool-1-thread-1]: org.jivesoftware.openfire.container.PluginManager - Successfully loaded plugin ‘admin’.

2016.04.21 10:22:46 INFO [pool-1-thread-1]: org.jivesoftware.openfire.container.PluginManager - Finished processing all plugins.

I’m not a developer myself, so i’m not sure what this development mode is. But maybe it is trying to run Openfire and tries to run it in https mode, and as you don’t have an SSL certificate it throws that error. Just a guess.

I realized the admin plugin would start after the setupmode is over. So I run the admin setup webapp in non-development mode.

Somehow the debug log is changed ,but still cannot make the proper jsp in development mode. the log is attached.

I also see similar problems appearing on stackoverflow.

I guess this is new and have something to do with the change of jars in classpath? Maybe missing some context settings or jars I suppose.

Anyway I wish someone could help me out of this.
all.log.zip (2745 Bytes)

Hi Simon,

It doesn’t help I know, but I see the same JSP compilation problems as you with -DdevelopmentMode=true

I’ve looked a little bit inside the code and the stack overflow responses for things like this - and as far as I can see the code should be setting up the necessary Jasper bits:

Openfire/AdminConsolePlugin.java at master · igniterealtime/Openfire · GitHub

See how it’s adding the JettyJasperInitializer? That should be enough to cause the tag library descriptors to be set up and pulled in - but it isn’t :-/

Unfortunately I don’t currently have enough understanding to know why that doesn’t work.

As you say, perhaps there is some classes or resources missing on the classpath.

Anyone with a better pay grade than me care to chime in?

The current classpath entries are listed here for anyone who might wish to help:

Openfire/classpath at master · igniterealtime/Openfire · GitHub

Dan

Hi Simon,

Is this has been fixed for you? I am facing same problem.

Thanks

Hi, Saurabh

I got a little occupied these days, so I haven’t figured it out.

However when I did some digging in the source, I found this might related to the func

org.jivesoftware.openfire.container.PluginServlet.handleDevJSP

Go see it yourself, it implies some usage of jars not exist in the source package.

As I said I’m a little busy with some other business, so maybe you could take a shot finding those missing jars?

Glad to hear your feedback if there’s anything lucky:)

Hi Simon + al,

I have succeeded in getting the admin JSP pages to work right by adding a jar and a bit of code tweaking. I haven’t yet checked if this correctly fixes non-admin page web apps, maybe someone else can check that for me?

For now here’s what to do if you don’t want to wait for a successful merge to the repository:

  • Download the full jetty distribution package from here (the .zip): http://archive.eclipse.org/jetty/9.2.14.v20151106/dist/

  • Extract the jetty-annotations-###.jar

  • Copy it into the OPENFIRESRCHOME/build/lib/merge as jetty-annotations.jar

  • Add it to the eclipse project classpath as a library (select project, right click properties, java build path, libraries, add jars, select it)

  • Modify the AdminConsolePlugin java file

Easiest thing here is to look at the pull request and extract that change from the file:

Allow JSP compilation with developmentMode=true by danielhams · Pull Request #585 · igniterealtime/Openfire · GitHub

And you should (hopefully) find that the admin pages at least are compiled.

Cheers

Dan

Great! Thanks a lot, glad to see it already merged to the master.