Initially driverManagerSource is used for MySQL DB connection, Now it have to be changed to DbManager connection in servlet,
the following error is shown in jsp once the servlet is accessed.
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /cc_acc_service/ccservice.do. Reason:
<pre> it/gotoandplay/smartfoxserver/db/DbManager</pre></p><h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: it/gotoandplay/smartfoxserver/db/DbManager.
Can you please guide me to access DbManager inside the jetty server.
Also provide necessary jar for accessing DbManager jetty server.
Accessing DbManager in jetty server
Re: Accessing DbManager in jetty server
Sounds like a classpath/classloader issue.
You shouldn't have problems because servlets should be able to see any of the server classes.
Have you tried accessing the class from a JSP page? Maybe there's some issue with the deployment of your servlet. Difficult to say without any further data.
thanks
You shouldn't have problems because servlets should be able to see any of the server classes.
Have you tried accessing the class from a JSP page? Maybe there's some issue with the deployment of your servlet. Difficult to say without any further data.
thanks
Re: Accessing DbManager in jetty server
It is working fine in db connection using DriverManagerDataSource .
But when I change the connection to DbManager for accessing DB connection, which is used in smartFoxServer, it fails to access the DbManager.
Also not have clear configuration for accessing from jetty server.
Can you walkthrough how to use DbManager instead of DriverManagerDataSource for getting DB connections in jetty Server?
Thanks
Vivek.
But when I change the connection to DbManager for accessing DB connection, which is used in smartFoxServer, it fails to access the DbManager.
Also not have clear configuration for accessing from jetty server.
Can you walkthrough how to use DbManager instead of DriverManagerDataSource for getting DB connections in jetty Server?
Thanks
Vivek.
Re: Accessing DbManager in jetty server
There shouldn't be any particular problem using the DBManager.
All you need to do is creating a webapp under your IDE (Netbeans / Eclipse etc...), add the jysfs.jar library as dependency and use the DBManager class in your code.
Then you deploy the webapp as a regular .war file, copy it to the webapps/ folder in the SFS file structure and start the server.
I have tested these simple steps and it works just fine.
NOTE: in the war file you don't need to pack the jysfs.jar file. The SFS lib is already visible in the main classpath and so will be the database driver if you have deployed it in the SFS lib/ folder.
Thanks
All you need to do is creating a webapp under your IDE (Netbeans / Eclipse etc...), add the jysfs.jar library as dependency and use the DBManager class in your code.
Then you deploy the webapp as a regular .war file, copy it to the webapps/ folder in the SFS file structure and start the server.
I have tested these simple steps and it works just fine.
NOTE: in the war file you don't need to pack the jysfs.jar file. The SFS lib is already visible in the main classpath and so will be the database driver if you have deployed it in the SFS lib/ folder.
Thanks
Re: Accessing DbManager in jetty server
I've tried what you have suggested, I have getting the following error while calling "DbManager db= new DbManager(DB_DRIVER,DB_URL,DB_USER,DB_PWD,"casino",10,21,"wait",10);".
The error is "it/gotoandplay/smartfoxserver/db/DbManager</pre></p><h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: it/gotoandplay/smartfoxserver/db/DbManager".
If this is a jar problem can you tell me the necessary jars to be placed inside server.
Even after placing the jysfs.jar inside jetty lib path, the same error occurs.....
Can you provide me a solution for this.....
Thanks
Vivek.
The error is "it/gotoandplay/smartfoxserver/db/DbManager</pre></p><h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: it/gotoandplay/smartfoxserver/db/DbManager".
If this is a jar problem can you tell me the necessary jars to be placed inside server.
Even after placing the jysfs.jar inside jetty lib path, the same error occurs.....
Can you provide me a solution for this.....
Thanks
Vivek.
Re: Accessing DbManager in jetty server
That doesn't right to me and it is not expected.
I have done the same test and it works just fine. No need to add any jar files anywhere.
Have you modified the classpath in the server's launch script? That's the only idea it comes to mind.
I have done the same test and it works just fine. No need to add any jar files anywhere.
Have you modified the classpath in the server's launch script? That's the only idea it comes to mind.
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 54 guests