Workflow learning notes (1)

Source: Internet
Author: User
In the past few days, I have encountered some problems while studying the workflow and taking the work of asking for leave based on Stephen's notes,
One problem has plagued me for several days. Recorded
The first exception is to configure the database: Org. Apache. commons. DBCP. sqlnestedexception: cannot create JDBC driver of class ''for onnect URL 'null'
This problem has been found on the Internet by many related netizens, but I have not made any mistakes.
My colleagues also helped me find it. I also felt that this configuration should not cause any problems. In the end, I felt that it was related to the Tomcat server.
After changing the version, the problem does not exist. At last, Zhang Jie helped me solve this problem. When I configured the database, I posted some differences between Tomcat 5.5 and tomcat 5.5. This is, you only need. add this code to the XML file.
<Context
Docbase = "myfirstworkflow"

Path = "/myfirstworkflow"
Reloadable = "true">
<Resource Name = "JDBC/test"
Auth = "Container"
Type = "javax. SQL. datasource"
Maxactive = "100"
Maxidle = "30"
Maxwait = "10000"
Driverclassname = "net. SourceForge. jtds. JDBC. Driver"
Username = "sa"
Password = "syb"
Url = "JDBC: jtds: sqlserver: // localhost: 1433/workflow"
Defaultautocommit = "true"
Removeabondoned = "true"
Removeabondonedtimeout = "60"
Logabondoned = "true"
/>

</Context>
5.0 is troublesome.
<Server port = "8005" shutdown = "shutdown" DEBUG = "0">

<! -- Comment out these entries to disable JMX mbeans support -->
<Listener classname = "org. Apache. Catalina. mbeans. serverlifecyclelistener"
DEBUG = "0"/>
<Listener classname = "org. Apache. Catalina. mbeans. globalresourceslifecyclelistener"
DEBUG = "0"/>

<Globalnamingresources>

 
<Environment name = "simplevalue" type = "Java. Lang. Integer" value = "30"/>

<! -- Editable user database that can also be used
Userdatabaserealm to authenticate users -->
<Resource Name = "userdatabase" auth = "Container"
Type = "org. Apache. Catalina. userdatabase"
Description = "user database that can be updated and saved">
</Resource>
<Resourceparams name = "userdatabase">
<Parameter>
<Name> factory </Name>
<Value> org. Apache. Catalina. Users. memoryuserdatabasefactory </value>
</Parameter>
<Parameter>
<Name> pathname </Name>
<Value> CONF/tomcat-users.xml </value>
</Parameter>
</Resourceparams>
<Resource Name = "JDBC/test"
Auth = "Container"
Type = "javax. SQL. datasource"/>
<Resourceparams name = "JDBC/test">
<Parameter>
<Name> factory </Name>
<Value> org. Apache. commons. DBCP. basicperformancefactory </value>
</Parameter>

<! -- Maximum number of DB connections in pool. Make sure you
Configure your mysqld max_connections large enough to handle
All of your DB connections. set to 0 for no limit.
-->
<Parameter>
<Name> maxactive </Name>
<Value> 100 </value>
</Parameter>

<! -- Maximum number of idle dB connections to retain in pool.
Set to-1 for no limit. See also the DBCP documentation on this
And the minevictableidletimemillis configuration parameter.
-->
<Parameter>
<Name> maxidle </Name>
<Value> 30 </value>
</Parameter>

<! -- Maximum time to wait for a DB connection to become available
In MS, in this example 10 seconds. An exception is thrown if
This timeout is exceeded. Set to-1 to wait indefinitely.
-->
<Parameter>
<Name> maxwait </Name>
<Value> 10000 </value>
</Parameter>

<! -- MySQL db username and password for DB connections -->
<Parameter>
<Name> username </Name>
<Value> SA </value>
</Parameter>
<Parameter>
<Name> password </Name>
<Value> syb </value>
</Parameter>

<Parameter>
<Name> driverclassname </Name>
<Value> net. SourceForge. jtds. JDBC. Driver </value>
</Parameter>
<Parameter>
<Name> URL </Name>
<Value> JDBC: jtds: sqlserver: // localhost: 1433/workflow </value>
</Parameter>
</Resourceparams>

</Globalnamingresources>
<Service name = "Catalina">
<Connector
Port = "5566" maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" redirectport = "8443" acceptcount = "100"
DEBUG = "0" connectiontimeout = "20000"
Disableuploadtimeout = "true"/>


<Connection Port = "8009"
Enablelookups = "false" redirectport = "8443" DEBUG = "0"
Protocol = "AJP/1.3" type = "codeph" text = "/codeph"/>


<Engine name = "Catalina" defaulthost = "localhost" DEBUG = "0">

<Logger classname = "org. Apache. Catalina. Logger. filelogger"
Prefix = "catalina_log." suffix = ". txt"
Timestamp = "true"/>

<Realm classname = "org. Apache. Catalina. realm. userdatabaserealm"
DEBUG = "0" resourcename = "userdatabase"/>

<Host name = "localhost" DEBUG = "0" appbase = "webapps"
Unpackwars = "true" autodeploy = "true">

<Logger classname = "org. Apache. Catalina. Logger. filelogger"
Directory = "logs" prefix = "localhost_log." suffix = ". txt"
Timestamp = "true"/>

<Context Path = "/myfirstworkflow" reloadable = "true" docbase = "/myfirstworkflow">

<Resourcelink name = "JDBC/test" Global = "JDBC/test" type = "javax. SQL. datasource"/>

</Context>

</Host>

</Engine>

</Service>

</Server>
In this way, the problem is solved.
Another problem:
Javax. Naming. namenotfoundexception: defaultds not bound
I originally configured the defaultds data source and later renamed the data source "test. However, this exception occurs in the console. This is very simple because I have not configured the propertyset. xml file. After I reconfigure this file, the problem is solved. The file content is as follows:
<Propertysets>
<Propertyset name = "JDBC" class = "com. opensymphony. Module. propertyset. database. jdbcpropertyset">
<Arg name = "datasource" value = "JDBC/test"/>
<Arg name = "table. Name" value = "OS _propertyentry"/>
<Arg name = "col. globalkey" value = "global_key"/>
<Arg name = "col. itemkey" value = "item_key"/>
<Arg name = "col. itemtype" value = "item_type"/>
<Arg name = "col. String" value = "string_value"/>
<Arg name = "col. Date" value = "date_value"/>
<Arg name = "col. Data" value = "data_value"/>
<Arg name = "col. Float" value = "float_value"/>
<Arg name = "col. Number" value = "number_value"/>
</Propertyset>
</Propertysets>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.