Announcement Announcement Module
Collapse
No announcement yet.
Exception with DriverManagerDataSource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception with DriverManagerDataSource

    Here is the data source configuration.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC
        "-//SPRING//DTD BEAN//EN"
        "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
      	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close" singleton="true">
            <property name="driverClassName">
        		<value>com.mysql.jdbc.Driver</value>
      		</property>
      		<property name="url">
        		<value>jdbc:mysql://172.16.20.20:3306/workflow_db</value>
      		</property>
      		<property name="username"><value>root</value></property>
      		<property name="password"><value>rdyh45td</value></property>
        </bean>
    </beans>
    But I got exception like:
    Code:
    2008-12-30 19:55:54,263 [org.hibernate.util.JDBCExceptionReporter] ERROR - The driver was unable to create a connection due to an inability to establish the client portion of a socket.
    
    This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable. 
    
    For Unix-based platforms, see the manual page for the 'ulimit' command. Kernel or system reconfiguration may also be required.
    
    For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (Q196271).
    2008-12-30 19:55:54,279 [org.hibernate.util.JDBCExceptionReporter] ERROR - The driver was unable to create a connection due to an inability to establish the client portion of a socket.
    
    This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable. 
    
    For Unix-based platforms, see the manual page for the 'ulimit' command. Kernel or system reconfiguration may also be required.
    
    For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (Q196271).
    2008-12-30 19:55:54,279 [org.hibernate.event.def.AbstractFlushingEventListener] ERROR - Could not synchronize database state with session
    org.hibernate.exception.JDBCConnectionException: Cannot open connection
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
    	at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:94)
    	at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
    	at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
    	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2354)
    	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
    	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
    	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
    	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
    	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
    	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
    	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
    	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
    	at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
    	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:420)
    	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    	at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:712)
    	at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:708)
    	at com.telenav.tnworkflow.dao.ConfigDao.saveOrUpdateConfig(ConfigDao.java:115)
    	at com.telenav.tnworkflow.workflow.ConfigMgr.setValue(ConfigMgr.java:98)
    	at com.telenav.tnworkflow.workflow.ModuleContext.save(ModuleContext.java:121)
    	at com.telenav.tnworkflow.workflow.execution.AbstractExecution.executeProcess(AbstractExecution.java:165)
    	at com.telenav.tnworkflow.workflow.execution.AbstractAction.execute(AbstractAction.java:109)
    	at org.jbpm.graph.def.Action.execute(Action.java:122)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
    	at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$918640e1.execute(<generated>)
    	at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:259)
    	at org.jbpm.graph.def.Node.execute(Node.java:338)
    	at org.jbpm.graph.def.Node.enter(Node.java:318)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
    	at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$485db285.enter(<generated>)
    	at org.jbpm.graph.def.Transition.take(Transition.java:151)
    	at org.jbpm.graph.def.Node.leave(Node.java:393)
    	at org.jbpm.graph.node.StartState.leave(StartState.java:70)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
    	at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$485db285.leave(<generated>)
    	at org.jbpm.graph.exe.Token.signal(Token.java:192)
    	at org.jbpm.graph.exe.Token.signal(Token.java:140)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
    	at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$c344d01.signal(<generated>)
    	at com.telenav.tnworkflow.workflow.WorkFlowInstance$1.run(WorkFlowInstance.java:161)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The driver was unable to create a connection due to an inability to establish the client portion of a socket.
    
    This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable. 
    
    For Unix-based platforms, see the manual page for the 'ulimit' command. Kernel or system reconfiguration may also be required.
    
    For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (Q196271).
    When I replaced the DriverManagerDataSource with "com.mchange.v2.c3p0.ComboPooledDataSource", another DB Connection Pool, everything was all right. How could this happend? Q196271 means I have to do some modification with my computer?


    Thanks,
Working...
X