• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Jforum Integration Issue with My Web application

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to integrating Jforum with my project and i tried this http://www.skill-guru.com/blog/2009/07/31/jforum-integration-with-a-spring-and-jsf-webapplication/

But when i am trying to access it with this Url http://localhost:8080/myapp/forums/list.page
i Got below exception


Can anyone tell What i miss to configure or something else?
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "integrate" mean? What changes have you made to the JForum code base? Did JForum run correctly before you made any changes?

Note that the preferred JForum version is the one at https://code.google.com/p/jforum2/ - it has multiple bug fixes and enhancements over the original version (which is no longer maintained).
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied all jar file into my project /WEB-INF/lib folder also copied config directory into WEB-INF folder and also SSO changes all those thing which mentioned in this link http://www.skill-guru.com/blog/2009/07/31/jforum-integration-with-a-spring-and-jsf-webapplication/ But i am getting exception which i mentioned in post
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cache subsystem seems unable to start up, but it's not clear hwy that is - apparently some class is missing. Make sure the cache settings in SystemGlobals.properties all make sense, and that the involved classes and jar files are present.

Did JForum run correctly before you made any changes?


?
In other words, have you gotten the web app to run is is? If not, that's what I would start with, before adding it to your web app.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for your reply...What i did?
1-First i download War from google Jforum2
2-Deploy it into Tomcat7 that war file
3-Start the server and create database and everything worked fine table created
4- After that i copied jar file and config folder into my project create a SSO class and made few changes SystemGlobals.properties for SSO
5- Start the server and tried to start my application my application worked fine but when i tried to access Jforum pages i got exception which i mentioned
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the problem started when you set up SSO? If so, maybe go back to the beginning when all worked beautifully, and take precise notes what you changed for the SSO integration.

By the way, do you actually need SSO? If you plan to integrate your web and JForum in a single web app anyway, maybe you don't...?
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made following changes


Here is my full file



Do you think this change causing issue?

And I need SSo because i want user login in my application and access forum from there
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea, I've never used SSO in JForum. The error message doesn't really sound like the problem has to do with SSO, though, but rather with the caching system. But maybe there's a connection.

And I need SSo because i want user login in my application and access forum from there


I see. When you were talking about "integrating Jforum with my project" I assumed you meant both would be part of the same web app - in which case you don't need SSO.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Forum is a part of my web application as i copied all things but how should be user will able to login or able to use same session of my application, in forum if we will not implement SSO?
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SSO is specifically for logging in once while accessing multiple servers (or multiple web apps on the same server). If there is only a single web app SSO is pointless, because there will only be a single session anyway (which you need to adapt so that it works for both web apps, but that should be easy).
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok but If you will check my First post of this thread you can see i added a link from which i made changes in my webapplication that link mentioned SSO implementation even when we are using Jforum in our own application.

Second thing i removed SSO as well but still i am end up with same Exception.
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to ask the author of that article why he implemented SSO.

The easiest is probably to start from scratch with a clean installation.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have better link where someone used jforum with his on project if so please tell me i will want to use it One thing i want to mentioned here my application database and Jforum database is different i mean instance are different
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JForum is a Java web app, and so can be altered and extended like any other web app. What are you struggling with, specifically?

Using several DBs from within the same web app is no problem.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only issue Why it is throwing Cache exception i am not able to figure out that .
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this approach to getting a cleanly running installation no longer works ?


1-First i download War from google Jforum2
2-Deploy it into Tomcat7 that war file
3-Start the server and create database and everything worked fine table created

 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upto this everything worked now i add all jar in my maven project and copied config folder inside /WEB-INF folder and copied templates folder inside webapps directory and started sever also made changes in web.xml file ...My project started but when i tried to access Jforum pages i am getting cache exception
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the exception stacktrace, this should be pretty straightforward to debug:


SEVERE: Allocate exception for servlet jforum
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at net.jforum.ConfigLoader.startCacheEngine(ConfigLoader.java:233)



My guess is that whatever class name is being passed is null. Now if you look at the code in ConfigLoader.startCacheEngine, you'll notice that it uses cache.engine.implementation property value to pass it to the Class.forName method. You'll have to figure out why that is being sent as null.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i do not have source code i am using Jforum.jar in my project so debug is not possible as per my knowledge
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The source code is at https://code.google.com/p/jforum2/source/checkout.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so now i have to copy paste all java code into my project to test the code?
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're familiar with the debugger built into your IDE, you can point it directly at the source code. If you're not using the debugger, you can add some logging to that code section -before the exception gets thrown!- that tells crucial information (values of variables etc.). Then you'd build a new JForum jar file and use that instead of the one that came with the JForum download.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you help me how here i found the issue


You can see this code reading properties file when i dig more i go this method



Now here preExpansion is coming null so everything comes null so its throw NullPointerException

Can you tell me why it is Null? Look like properties file not able to load Why i do not know
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which key is not found? Is that present in the properties file?
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It look like its not able to properties file
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you move it, or change file permissions? If you deploy the war file then it should be exactly where it needs to be (in WEB-INF/config, along with all the other configuration files).
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is there but look like SystemGlobals not initialize any idea when this class would be internalize i mean at server statup or somewhere else ..I am sure issue is coming with this class its not initialized so properties file not loaded and i am getting NullPointer issue
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put the debug point on this code



But this method not called if this will not load it will not able to load properties file and we will end with NullPointerException But i dont know when and how it will call by Jforum
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file is loaded from ConfigLoader.startSystemglobals - make sure that (and the methods in SystemGlobals it calls) are working correctly.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not know but this method never called as i put break point but its not called
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the context listener defined properly (it in turn calls ConfigLoader.startSystemglobals)? Does it run? You should see some output of it in the logs.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it define right in web.xml and when i tried this Url
http://localhost:8080/3c/forums/list.page

And it called



and this called super init method


Now when this line called


It throw exception becuse properties not loaded
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does that mean that you do see the output of the context listener in the log files?
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this


In this folder

C:\newSVN_Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\logs



We will get some other log file as well i did not get any other log file my project generates
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the access log, not the application log. If you're using Tomcat, check Catalina.out.

Also, those are not JForum URLs, so I'm not sure what you're looking at.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is log output

Jul 18, 2014 11:04:54 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_15\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk1.7.0_15/bin/../jre/bin/server;C:/Program Files/Java/jdk1.7.0_15/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0_15/bin/../jre/lib/amd64;C:\app\sjoshi\product\11.2.0\client_1\bin;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Gnostice\PDFOne.NET\Bin;C:\Program Files (x86)\Gnostice\PDFOne.NET\Bin;C:\PROGRA~2\COMMON~1\LEADTO~1\Help;C:\LEADTO~1.5\Bin\CDLL\Win32;C:\LEADTO~1.5\Bin\CDLL\x64;C:\LEADTO~1.5\Bin\Dotnet\Win32;C:\LEADTO~1.5\Bin\Dotnet\x64;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\CSDC\PB903dll;C:\php;C:\Program Files\doxygen\bin;C:\Program Files\Java\jdk1.7.0_15\bin;C:\Primefaces\maven\apache-maven-3.0.4\bin;C:\Java\apache-ant-1.7.1\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Groovy\Groovy-2.1.3\bin;C:\Program Files\TortoiseHg\;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.5\;C:\Program Files\TortoiseSVN\bin;C:\Java\eclipse-4.3\eclipse;;.
Jul 18, 2014 11:04:54 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:3c' did not find a matching property.
Jul 18, 2014 11:04:54 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context/Realm} Setting property 'debug' to '99' did not find a matching property.
Jul 18, 2014 11:04:54 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context/Realm} Setting property 'localDataSource' to 'true' did not find a matching property.
Jul 18, 2014 11:04:54 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 18, 2014 11:04:54 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 18, 2014 11:04:54 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1089 ms
Jul 18, 2014 11:04:54 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 18, 2014 11:04:54 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.29
Jul 18, 2014 11:05:00 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\newSVN_Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\3c\WEB-INF\lib\el-api-2.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
Jul 18, 2014 11:05:00 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\newSVN_Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\3c\WEB-INF\lib\servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jul 18, 2014 11:05:34 AM org.apache.catalina.startup.ContextConfig validateSecurityRoles
INFO: WARNING: Security role name Admin used in an <auth-constraint> without being defined in a <security-role>
Jul 18, 2014 11:05:34 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 18, 2014 11:05:34 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Hibernate: SELECT max(umul_user_id) as umul_user_id FROM um_users_list
Hibernate: SELECT max(gto_id) as gto_id From group_tweet_order
Hibernate: SELECT max(gd_id) as gd_id From group_distribution
Hibernate: SELECT max(group_id) as group_id From groups
Jul 18, 2014 11:05:45 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.11 ( 20120711-1632) for context '/3c'
Jul 18, 2014 11:05:49 AM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jul 18, 2014 11:05:52 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 5.0
Jul 18, 2014 11:05:52 AM org.primefaces.extensions.application.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces Extensions 2.0.0
Jul 18, 2014 11:05:52 AM org.omnifaces.VersionLoggerEventListener processEvent
INFO: Using OmniFaces version 1.8.1-20140603
Jul 18, 2014 11:05:52 AM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring jndi:/localhost/3c/WEB-INF/faces-config.xml for modifications
Jul 18, 2014 11:05:53 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 18, 2014 11:05:53 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 18, 2014 11:05:53 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 58881 ms
Jul 18, 2014 11:05:57 AM com.sun.faces.context.SessionMap put
WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession (key: loginBean, value class: com.ccc.web.view.LoginBean).
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/main_bg.jpg.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/AK1.png.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/nav.jpg.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/search.jpg.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/search_button.jpg.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/lock.jpg.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/banner.jpg.
Jul 18, 2014 11:05:58 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/footer_bg.jpg.



Will it helpful?
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any indication that there is an instance of JForum starting up; is its output in some other log file, maybe? Check the "logs" directory of your Tomcat installation.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i tried this



I'm not sure if you were after catalina.out or one of the other logs produced by Tomcat. But, if you're after the catalina.out log file then follow the directions below:

In the servers tab, double-click on the Tomcat Server. You will get a screen called Overview. Click on "Open launch configuration". Click on the "Common" tab. Towards the bottom of the screen you can check the "File" checkbox and then specify a file that can be used to log your console (catalina.out) output. Finally, restart the Tomcat server.



I tried this Link to get log from Eclipse
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, I have no idea how the Eclipse/Tomcat integration works, but I do know that many people struggle to get it to work (which is why I recommend to use a standalone Tomcat instead).

JForum2 is set up to log into a file called "jforum.log", which in a standalone Tomcat would be in the "logs" directory.
 
subodh joshi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm let me try to get out something else so i can give you whole log ..For the same time if i will deploy Jforum in tomcat where my application is already deployed How would it will work from login session of my application ?i mean to say if i login in my application with some userid and password same session will work for Jforum as well?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!