Grails upgrade from 1.3.7 to Grails 2.1.0.
Grails run-app executed. No errors.
Call to webflow action throws GrailsExceptionResolver error. States a grails webflow object isn’t serializable. I have navigated all classes to ensure all have ‘implements serializable’.
Error not identifying object not being serialized, so unable to identify if a class field should be made transient to be ignored by serializable runtime.
Full Stacktrace:
2016-12-20 09:51:25,750 [http-bio-80-exec-1] DEBUG services.RpgService - ************
| Error 2016-12-20 09:51:26,450 [http-bio-80-exec-1] ERROR errors.GrailsExceptionResolver - NotSerializableException occurred when processing request: [GET] /…/…/order
org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext. Stacktrace follows:
Message: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable
Line | Method
->> 384 | doFilterInternal in org.jsecurity.web.servlet.JsecurityFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 183 | doFilter in org.jsecurity.web.servlet.OncePerRequestFilter
| 886 | runTask . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . . . . . in java.lang.Thread
Caused by NotSerializableException: org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext
->> 1164 | writeObject0 in java.io.ObjectOutputStream
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1518 | defaultWriteFields in ''
| 1483 | writeSerialData in ''
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 1518 | defaultWriteFields in ''
| 1483 | writeSerialData in ''
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 330 | writeObject in ''
| 1001 | writeObject . . in java.util.HashMap
| 940 | invokeWriteObject in java.io.ObjectStreamClass
| 1469 | writeSerialData in java.io.ObjectOutputStream
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 1518 | defaultWriteFields in ''
Found the resolution.
My controller service was calling sessionFactory which also needed to be transient.
code change:
def sessionFactory => transient sessionFactory.
Did not need make any domain class variables transient directly.
fixed the issue.
Related
No connection between the controller and open vswitch.
opendaylight-user#root>info
Karaf
Karaf version 4.0.10
Karaf home /opt/odl
Karaf base /opt/odl
OSGi Framework org.eclipse.osgi-3.10.101.v20150820-1432
JVM
Java Virtual Machine OpenJDK 64-Bit Server VM version 25.144-b01
Version 1.8.0_144
Vendor Oracle Corporation
Pid 4312
Uptime 19 hours 16 minutes
Total compile time 3 minutes
Threads
Live threads 218
Daemon threads 99
Peak 221
Total started 8170
Memory
Current heap size 621,509 kbytes
Maximum heap size 1,864,192 kbytes
Committed heap size 1,030,144 kbytes
Pending objects 0
Garbage collector Name = 'PS Scavenge', Collections = 533, Time = 12.404 seconds
Garbage collector Name = 'PS MarkSweep', Collections = 24, Time = 15.571 seconds
Classes
Current classes loaded 23,639
Total classes loaded 23,827
Total classes unloaded 188
Operating system
Name Linux version 3.10.0-514.21.1.el7.x86_64
Architecture amd64
Processors 4
opendaylight-user#root>
The OpenFlow Session stats show. The 10.10.10.10 is the IP address of the switch:
opendaylight-user#root>ofp:show-session-stats
SESSION : /10.10.10.10:35616
CONNECTION_DISCONNECTED_BY_DEVICE : 1
SESSION : /10.10.10.10:35592
CONNECTION_DISCONNECTED_BY_DEVICE : 1
SESSION : /10.10.10.10:35608
CONNECTION_DISCONNECTED_BY_DEVICE : 1
SESSION : /10.10.10.10:51110
CONNECTION_DISCONNECTED_BY_DEVICE : 1
SESSION : /10.10.10.10:35610
CONNECTION_DISCONNECTED_BY_DEVICE : 1
SESSION : /10.10.10.10:35612
CONNECTION_DISCONNECTED_BY_DEVICE : 1
SESSION : /10.10.10.10:35614
CONNECTION_DISCONNECTED_BY_DEVICE : 1
opendaylight-user#root>
The logs show the following lines:
2018-02-26 11:54:08,732 | DEBUG | pool-58-thread-1 | LLDPSpeaker | 296 - org.opendaylight.openflowplugin.applications.lldp-speaker - 0.5.1 | Sending LLDP frames to 0 ports...
2018-02-26 11:54:10,092 | DEBUG | ntLoopGroup-15-7 | nflowProtocolListenerInitialImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | echo request received: 0
2018-02-26 11:54:13,732 | DEBUG | pool-58-thread-1 | LLDPSpeaker | 296 - org.opendaylight.openflowplugin.applications.lldp-speaker - 0.5.1 | Sending LLDP frames to 0 ports...
2018-02-26 11:54:15,092 | DEBUG | ntLoopGroup-15-7 | nflowProtocolListenerInitialImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | echo request received: 0
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_TRANSLATE_IN_SUCCESS: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_TRANSLATE_OUT_SUCCESS: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_TRANSLATE_SRC_FAILURE: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_PACKET_IN_LIMIT_REACHED_AND_DROPPED: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_NOTIFICATION_REJECTED: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_PUBLISHED_SUCCESS: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | FROM_SWITCH_PUBLISHED_FAILURE: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_ENTERED: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_DISREGARDED: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_RESERVATION_REJECTED: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_READY_FOR_SUBMIT: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_SUBMIT_SUCCESS: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_SUBMIT_SUCCESS_NO_RESPONSE: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_SUBMIT_FAILURE: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | TO_SWITCH_SUBMIT_ERROR: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | REQUEST_STACK_FREED: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | OFJ_BACKPRESSURE_ON: no activity detected
2018-02-26 11:54:16,073 | DEBUG | pool-75-thread-1 | MessageIntelligenceAgencyImpl | 305 - org.opendaylight.openflowplugin.impl - 0.5.1 | OFJ_BACKPRESSURE_OFF: no activity detected
No nodes in OpenFlow topology:
opendaylight-user#root>openflow:getallnodes
No node is connected yet
opendaylight-user#root>
On the wire, I see OpenFlow packets between the controller and the switch:
Frame 1: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Internet Protocol Version 4, Src: 10.10.10.10 (10.10.10.10), Dst: 10.10.10.20 (10.10.10.20)
Transmission Control Protocol, Src Port: 35338 (35338), Dst Port: openflow (6653), Seq: 1, Ack: 1, Len: 8
Openflow Protocol
Header
Version: 0x04
Type: Echo request (SM) - OFPT_ECHO_REQUEST (2)
Length: 8
Transaction ID: 0
Frame 2: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Internet Protocol Version 4, Src: 10.10.10.20 (10.10.10.20), Dst: 10.10.10.10 (10.10.10.10)
Transmission Control Protocol, Src Port: openflow (6653), Dst Port: 35338 (35338), Seq: 1, Ack: 9, Len: 8
Openflow Protocol
Header
Version: 0x04
Type: Echo reply (SM) - OFPT_ECHO_REPLY (3)
Length: 8
Transaction ID: 0
Frame 3: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Internet Protocol Version 4, Src: 10.10.10.10 (10.10.10.10), Dst: 10.10.10.20 (10.10.10.20)
Transmission Control Protocol, Src Port: 35338 (35338), Dst Port: openflow (6653), Seq: 9, Ack: 9, Len: 0
Flags: 0x010 (ACK)
000. .... .... = Reserved: Not set
...0 .... .... = Nonce: Not set
.... 0... .... = Congestion Window Reduced (CWR): Not set
.... .0.. .... = ECN-Echo: Not set
.... ..0. .... = Urgent: Not set
.... ...1 .... = Acknowledgment: Set
.... .... 0... = Push: Not set
.... .... .0.. = Reset: Not set
.... .... ..0. = Syn: Not set
.... .... ...0 = Fin: Not set
Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
No-Operation (NOP)
Type: 1
0... .... = Copy on fragmentation: No
.00. .... = Class: Control (0)
...0 0001 = Number: No-Operation (NOP) (1)
Timestamps: TSval 140811003, TSecr 165720510
Kind: Timestamp (8)
Length: 10
Timestamp value: 140811003
Timestamp echo reply: 165720510
Now, on Open vSwitch side:
# ovs-vsctl show
934472aa-72ca-4f61-834c-a86bd41a9b27
Manager "tcp:10.10.10.20:6640"
is_connected: true
Bridge "vsw0"
Controller "tcp:10.10.10.20:6653"
is_connected: true
Port "339bfa2f6b7b4_l"
Interface "339bfa2f6b7b4_l"
Port "0de326ec0ace4_l"
Interface "0de326ec0ace4_l"
Port "vsw0"
Interface "vsw0"
type: internal
ovs_version: "2.9.0"
The controller goes from ACTIVE to IDLE:
# ovs-vsctl list controller
_uuid : ac3f5c94-624a-47ce-90c3-782060e4ec3c
connection_mode : []
controller_burst_limit: []
controller_rate_limit: []
enable_async_messages: []
external_ids : {}
inactivity_probe : []
is_connected : true
local_gateway : []
local_ip : []
local_netmask : []
max_backoff : []
other_config : {}
role : other
status : {sec_since_connect="42353", state=ACTIVE}
target : "tcp:10.10.10.20:6653"
The logs show the following.
2018-02-26T16:59:55.091Z|90890|vconn|DBG|tcp:10.10.10.20:6653: sent (Success): OFPT_ECHO_REQUEST (OF1.3) (xid=0x0): 0 bytes of payload
2018-02-26T16:59:55.092Z|90891|vconn|DBG|tcp:10.10.10.20:6653: received: OFPT_ECHO_REPLY (OF1.3) (xid=0x0): 0 bytes of payload
2018-02-26T16:59:55.092Z|90892|rconn|DBG|vsw0<->tcp:10.10.10.20:6653: entering ACTIVE
2018-02-26T17:00:00.091Z|90893|rconn|DBG|vsw0<->tcp:10.10.10.20:6653: idle 5 seconds, sending inactivity probe
2018-02-26T17:00:00.091Z|90894|rconn|DBG|vsw0<->tcp:10.10.10.20:6653: entering IDLE
Any ideas why the OF connection is not being formed?
The issue was that the bridge was not set with OpenFlow 1.3 protocol.
ovs-vsctl set bridge vsw0 protocols=OpenFlow13
Right after that, the session came up:
opendaylight-user#root>ofp:show-session-stats
SESSION : openflow:231865136161864
CONNECTION_CREATED : 1
opendaylight-user#root>
The controller is now "master":
# ovs-vsctl list controller
_uuid : ac3f5c94-624a-47ce-90c3-782060e4ec3c
connection_mode : []
controller_burst_limit: []
controller_rate_limit: []
enable_async_messages: []
external_ids : {}
inactivity_probe : []
is_connected : true
local_gateway : []
local_ip : []
local_netmask : []
max_backoff : []
other_config : {}
role : master
status : {sec_since_connect="116", state=ACTIVE}
target : "tcp:10.10.10.20:6653"
Background:
The "configure()" method, in the sample code below, loops at specified time interval at which time I wish to log the current "ZonedDateTime.now() value
Problem:
The ZonedDateTime.now() value is always the same value, despite the interval time difference.
Question:
What technique can I used to access the current ZonedDateTime.now() value at each interval?
(NOTE: I ultimately, wish to use this value as a parameter in a REST call)
Sample code:
package aaa.bbb.ccc.dateparmissue;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
#ContextName("rest-dsl")
public class DateParmIssue extends RouteBuilder {
public DateParmIssue() {
}
private final String codeList = "AA,BB,CC";
private final int notifyTime = 10; //<==10 second interval
#Override
public void configure() throws Exception {
org.apache.log4j.MDC.put("app.name", "dateParmIssue");
System.getProperties().list(System.out);
onException(Exception.class)
.log("onException_processing_exception:" + this.exceptionMessage().toString() + "...send to_error_queue:" + body(String.class).toString())
.handled(true);
from("timer://foo?fixedRate=true&period=" + (notifyTime * 1000))
.setBody(constant(this.codeList))
.to("seda:node0");
from("seda:node0")
.split().tokenize(",")
.to("seda:node1");
from("seda:node1")
.log("seda:node1...body-code=${body}...zdt=" + simple(ZonedDateTime.now().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)));
}
}
Sample output...
2017-12-27 12:17:11,649 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=AA...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:11,653 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=BB...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:11,653 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=CC...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:21,630 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=AA...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:21,630 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=BB...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:21,631 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=CC...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:31,633 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=AA...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:31,636 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=BB...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:31,637 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=CC...zdt=Simple: 2017-12-27T12:17:10.306-05:00
It turns out that the "timer" inserts a "firedTime" property in the header that can be used (although it is currently as a java.util.Date object, rather than one of the newer Java 8 date objects - e.g., ZonedDateTime).
So, an alternative might be as follows - i.e., which shows the changing date...
from("seda:node1")
.process(new Processor(){
public void process(Exchange exchange) {
exchange.getIn().setHeader("code", exchange.getIn().getBody().toString());
exchange.getIn().setBody((new Date(exchange.getIn().getHeader("firedTime").toString()).toInstant()).atZone(ZoneId.systemDefault()).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
}
})
.log("seda:node1...body-code=${in.header.code}...zdt=${body}");
...and date now changes...
2017-12-28 15:37:18,017 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=AA...zdt=2017-12-28T15:37:18-05:00
2017-12-28 15:37:18,019 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=BB...zdt=2017-12-28T15:37:18-05:00
2017-12-28 15:37:18,020 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=CC...zdt=2017-12-28T15:37:18-05:00
2017-12-28 15:37:28,017 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=AA...zdt=2017-12-28T15:37:28-05:00
2017-12-28 15:37:28,017 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=BB...zdt=2017-12-28T15:37:28-05:00
2017-12-28 15:37:28,018 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=CC...zdt=2017-12-28T15:37:28-05:00
My senior created a remote oracle JDBC, I have to connect to specific WiFi to access the database scheme. Even though I configure my DataSource.groovy as below:
dataSource {
pooled = true
jmxExport = true
driverClassName = "oracle.jdbc.OracleDriver"
username = "test"
password = "pass"}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
}
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:oracle:thin:#10.42.0.1:1521:xe"
username = "test"
password = "pass"
driverClassName = "oracle.jdbc.OracleDriver"
dialect = imocha.hibernate.dialect.Oracle11gDialect
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:oracle:thin:#10.42.0.1:1521:xe"
username = "test"
password = "pass"
driverClassName = "oracle.jdbc.OracleDriver"
dialect = imocha.hibernate.dialect.Oracle11gDialect
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:oracle:thin:#10.42.0.1:1521:xe"
username = "test"
password = "pass"
driverClassName = "oracle.jdbc.OracleDriver"
dialect = imocha.hibernate.dialect.Oracle11gDialect
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
}
}
But it still shows unable to create initial connections of pool issues in Grails. I have cleared the proxy in my Grails (the place I working require proxy to connect to WiFi) as my senior say proxy will affect the connection in Grails. I would like to know what is the reason that I can't connect to remote database.
I have attached the error logs below:
| Error 2017-04-21 17:26:05,744 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: oracle.jdbc.OracleDriver
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ClassNotFoundException: oracle.jdbc.OracleDriver
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 274 | forName . in java.lang.Class
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error 2017-04-21 17:26:06,330 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: oracle.jdbc.OracleDriver
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ClassNotFoundException: oracle.jdbc.OracleDriver
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 274 | forName . in java.lang.Class
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error 2017-04-21 17:26:06,917 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ClassNotFoundException: oracle.jdbc.OracleDriver
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 274 | forName . in java.lang.Class
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error 2017-04-21 17:26:07,185 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing Grails: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ClassNotFoundException: oracle.jdbc.OracleDriver
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 274 | forName . in java.lang.Class
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error 2017-04-21 17:26:07,283 [localhost-startStop-1] ERROR [localhost].[/testDB] - Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by SQLException: oracle.jdbc.OracleDriver
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ClassNotFoundException: oracle.jdbc.OracleDriver
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 274 | forName . in java.lang.Class
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error 2017-04-21 17:26:07,399 [localhost-startStop-1] ERROR core.StandardContext - Error listenerStart
| Error 2017-04-21 17:26:07,446 [localhost-startStop-1] ERROR core.StandardContext - Context [/testDB] startup failed due to previous errors
Thank you.
PS I am using Grails 2
You're getting a ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Is your ojdbcXX.jar on the application's classpath?
Depending on the version of Oracle you're using (seems to be 11) you may just need to change the driver package name from:
driverClassName = "oracle.jdbc.driver.OracleDriver"
To
driverClassName: 'oracle.jdbc.OracleDriver'
I have a scenario in a Grails project where I am storing domain object in an HTTP session. This is arguably not a great practice, but I'm not in a position to change that at the moment.
The issue I'm encountering is that if I hit an unhandled exception, and then attempt to logout (authentication is using Spring Security) I will be unable to logout and will get another LazyInitialization exception (not even on the same collection as before.)
What I don't understand is what Spring Security is trying to do with these detached domain objects in the HTTP session.
If I look through the Grails docs, there are examples on how to reattach things to the Hibernate session: http://grails.org/doc/latest/ref/Domain%20Classes/attach.html. In this case though, I don't even want to reattach these objects. I'm done with them. It seems like spring security is looking in the HTTP session and trying to do something with those objects, but I'm not sure what, or how to fix it.
Full stack trace:
Line | Method
->> 1418 | writeOrdinaryObject in java.io.ObjectOutputStream
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1177 | writeObject0 in ''
| 1547 | defaultWriteFields in ''
| 1508 | writeSerialData in ''
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 1547 | defaultWriteFields in ''
| 1508 | writeSerialData in ''
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 347 | writeObject . . . . in ''
| 1128 | writeObject in java.util.HashMap
| 988 | invokeWriteObject . in java.io.ObjectStreamClass
| 1495 | writeSerialData in java.io.ObjectOutputStream
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 1547 | defaultWriteFields in ''
| 1508 | writeSerialData in ''
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 1547 | defaultWriteFields in ''
| 1508 | writeSerialData in ''
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 1547 | defaultWriteFields in ''
| 1508 | writeSerialData in ''
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 347 | writeObject . . . . in ''
| 1129 | writeObject in java.util.HashMap
| 988 | invokeWriteObject . in java.io.ObjectStreamClass
| 1495 | writeSerialData in java.io.ObjectOutputStream
| 1431 | writeOrdinaryObject in ''
| 1177 | writeObject0 in ''
| 347 | writeObject . . . . in ''
| 74 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 1145 | runWorker . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . in java.lang.Thread
I upgraded my Grails project from grails-2.3.7 to grails-2.4.0 and followed the guide http://grails.org/doc/2.4.x/guide/upgradingFrom23.html. However, trying to run the app now yields the stack trace below. How do I fix this?
| Running Grails application
| Error 2014-06-12 15:45:55,788 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'grailsApplicationPostProcessor': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/annotation/AnnotatedElementUtils
Message: Error creating bean with name 'grailsApplicationPostProcessor': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/annotation/AnnotatedElementUtils
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Caused by NoClassDefFoundError: org/springframework/core/annotation/AnnotatedElementUtils
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Caused by ClassNotFoundException: org.springframework.core.annotation.AnnotatedElementUtils
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 262 | run . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
| Error Forked Grails VM exited with error
Please run
grails dependency-report
And check that your application is not pulling in an older version of Spring. If you can paste the output into the question, you should see an older version of some Spring JAR in your dependency report, which is causing the issue. Grails 2.4 requires Spring 4.0.5 or above