I try to connect to MySQL database (works perfect when I connect to it without servlet) and get the below error all the time:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
This error means (as I understand) that I don't have some jar files in my project. but this is not true, because I have those Jars. !Moreover, if I realy didn't had those jar, I could not have connected to the database anyway.
What I missed?
By looking at those tags this is a web application. So the error clearly states you don't have your SQL Venders Driver jars in the class path.
You can put this jar in your Project/WEB-INF/lib folder and restart whatever web server you are using. Then you will be good to go.
Your mysql jdbc jar driver isn't in your classpath.
If you run it from a servlet, it uses the classpath of your servlet container. This classpath probably contains it.
Find mysql-connector-java where you can, and copy into your classpath.
Related
I have run the table scripts in mysql and done all steps according to the following link
https://groups.google.com/forum/#!topic/camunda-bpm-users/O8dpppcvwt8
But this link has apache set up so the files where I have to edit the dependencies are not present in wildfly. Also where to set up the jdbc url and connections?
Softwares I have
mysql-5.6.24-winx64
wildfly-8.2.1.Final
camunda-bpm-wildfly-7.4.0
You have to create a mysql wildfly module and add the driver to the server configuration as described in this tutorial. You than have to adjust the configuration of the process engine data source like described in the installation guide.
I read in c3p0´s manual link that it is possible to use c3p0 library inside JBOSS as an MBean.
Once configured correctly, I would like to reference the new C3P0PooledDataSource in my Java WAR through its JNDI name. As I am using Spring
it would be something similar to:
[src/webapp/WEB-INF/applicationContext.xml]
<jee:jndi-lookup id="dataSource" jndi-name="java:PooledDS" />
However, I don´t know how to configure this library properly. I tried to place c3p0-0.9.2.1.jar and c3p0-service.xml in the folders commented in the manual
but I had no luck.
I am currently developing a project which uses a MySql database, so I have instaled the mysql connector inside the JBOSS AS 7.1.1 server.
I have to say that if I integrate c3p0 and MySql connector in my project I can deploy it correctly. So...:
Is it possible to use c3p0 connection pool inside JBOSS AS 7.1.1 as described in its manual? How should I configure it?
I started to "play" with c3p0 because of its large number of configuration properties, but I don´t know if c3p0 is better than embedded JBOSS pooling capabilities.
Does c3p0 library deserve to be used instead of JBOSS embedded connection pool (i.e. configuring a datasource with the admin console/web) ?
I appreciate any comments to these matters.
Thanks in advance.
I can not configure the proxy to download the dependencies:
Initially when I tried to build the project. received the message timeout. Now gotta find a configuration file that solved my problem in parts.
the file is net.properties which is inside the directory of the jdk, it is where I can specify the proxy server but can not get past the User and password for authentication.
any idea what to do?
You could try setting the following additional parameters in your net.properties file.
http.proxyUser=xxxxx
http.proxyPassword=xxxxx
Else, you can setup a local proxy server (with no authentication) which supports authentication to the proxy server you are using and point your net.properties to it.
Cheers.
I have a simple (no authentication yet) Lightswitch VS 2012 app. That on my local computer connects to a mysql database (the database is hosted by my hosting company). All works well.
I then 'publish' this app to my local IIS server, and copy all that to my hosting companies server.
It mostly works, except the WCF service won't work. Upon connecting to the WCF service directly (the .svc file) I get a 'request error'. The stack trace in the Trace.axd is as follows
[Microsoft.LightSwitch.DataService][Application:Error][LightSwitchServiceApplication.vinyldyeData:CreateObjectContext] An exception has occurred: System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
at LightSwitchApplication.Implementation.vinyldyeDataServiceImplementation.CreateObjectContext()
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.get_ObjectContext()
It looked as though the hosting company just doesn't have the MySQL Connector in the GAC, so i've added this into the bin folder, still get the same error.
I've looked in the Web.configs, and there is no mention of mysql connector, how does the app know which connector to use?
Have you deployed a Lightswitch app to a host using mysql? if so what files am i missing, or config option.
thanks
Since you've already added the MySQL Connector (I assume 6.4.4) DLLs to the bin folder, refer to this post. Worked for me.
I want to create a simple lift web application which read input throug form and insert it into database.
You need to add mysql jdbc driver to your project (as a maven artifact, or via sbt, or just put jar in CLASSPATH) and edit properties file (props/default.props):
db.driver=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost/your_db_name
db.user=user
db.password=password
Also, you can setup db context in app container (Tomcat, etc.) instead. After that you can use Lift's ORM (Mapper).