SwitchEV / RISE-V2G

The only fully-featured reference implementation of the Vehicle-2-Grid communication interface ISO 15118
MIT License
220 stars 92 forks source link

java.lang.ClassCastException occurred. #88

Open freest4r opened 2 years ago

freest4r commented 2 years ago

RISE_SECC_log.txt ChargeParameterDiscoveryReq.txt

Recently I'm working on testing ISO 15118-2. Thanks to RISE, I can do my research well. thank you.

To test rise-v2g-secc-1.2.6.jar, I implement EVCC that transmits unexpected XMLs. In this process, I found several errors and today I would like to report the one of the errors.

In "ChargeParameterDiscoveryReq" step, if "DepartureTime" of "AC_EVChargeParameter" is empty (</ns3:DepartureTime>), RuntimeException is occurred in rise-v2g-secc-1.2.6.jar. but it's OK because rise-v2g-secc-1.2.6.jar send "FAILED_SequenceError" to EVCC.

At this time, If EVCC connect to rise-v2g-secc-1.2.6.jar and send normal SupportedAppProtocolReq, then "java.lang.ClassCastException" is occurred.

The exception message is like below:

java.lang.ClassCastException: class com.v2gclarity.risev2g.shared.v2gMessages.appProtocol.AppProtocolType cannot be cast to class javax.xml.bind.JAXBElement (com.v2gclarity.risev2g.shared.v2gMessages.appProtocol.AppProtocolType and javax.xml.bind.JAXBElement are in unnamed module of loader 'app')

Then, rise-v2g-secc-1.2.6.jar send "Failed_NoNegotiation" to the EVCC. Even though the SupportedAppProtocolReq message was normal.

I'm not sure why it happens, but I attached logs and ChargeParameterDiscoveryReq.xml files.

In summary, the reproduce process is as follows:

  1. run rise-v2g-secc-1.2.6.jar
  2. EVCC connect to the rise-v2g-secc-1.2.6.jar and continues the process normally until the ChargeParameterDiscoveryReq step.
  3. At ChargeParameterDiscoveryReq step, send attached ChargeParameterDiscoveryReq.xml file to rise-v2g-secc-1.2.6.jar.
  4. java.lang.RuntimeException occurred -> FAILED_SequenceError -> Connection closed
  5. EVCC connect to the rise-v2g-secc-1.2.6.jar again and send normal SupportedAppProtocolReq message.
  6. java.lang.ClassCastException occurred -> Failed_NoNegotiation -> connection closed