Git Product home page Git Product logo

vefa-srest's Introduction

Ringo - the PEPPOL Access Point back end

Table of contents

This repository contains, "Ringo", a REST-based system for managing the "back-end" for a PEPPOL Access Point running Oxalis.

Ringo was originally developed by Steinar Overbeck Cook, SendRegning, which was taken over by Unit4 in 2012. Unit4 has kindly donated the software to the Norwegian agency for Public Management and eGovernment (Difi), which now looks after the software.

Ringo was developed to be used with the MySQL database. It has been confirmed to work with H2 and Microsoft SQL Server as well. If you would like to use a different database, please contribute and send us a pull request.

Installation

Please refer to the Installation guide

Troubleshooting

When messages transmission fails, inspect the error that was logged in the
outbound_message_queue_error table. Typical exception messages are shown below together with brief guide on the steps needed to rectify the issue.

Receivers PEPPOL certificate expired

Typical exception and error message shown below.

java.lang.RuntimeException: Failed to get valid certificate from Endpoint data
Caused by: java.security.cert.CertificateExpiredException: NotAfter: Fri Mar 17 00:59:59 CET 2017
  1. When this happens, notify the receiving accesspoint directly.
  2. Contact information can be found in ELMA.
  3. Message can be resent when the receiving ap has renewed with PEPPOL and updated their certificate in the SMP.

Invalid HTTPS certificate

Typical exception will have traces of javax.net.ssl in them and example error message shown below.

java.lang.IllegalStateException: Unexpected error during execution of http POST to https://ap.somewhere.no/oxalis/as2
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  1. When this happens, notify the receiving accesspoint directly.
  2. Contact information can be found in ELMA.
  3. Message can be resent when the receiving ap has fixed their certificate issues (in this case incomplete chain)

Expired HTTPS certificate

Typical exception will have traces of javax.net.ssl in them and example error message shown below.

java.lang.IllegalStateException: Unexpected error during execution of http POST to https://ap.somewhere.no/oxalis/as2
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
Caused by: java.security.cert.CertPathValidatorException: timestamp check failed
Caused by: java.security.cert.CertificateExpiredException: NotAfter: Mon Oct 24 14:00:00 CEST 2016
  1. Contact receiving accesspoint

Access Point not available

Typical exception and error messages shown below.

java.lang.IllegalStateException: Unexpected error during execution of http POST to https://ap.somewhere.no/oxalis/as2
Caused by: java.net.SocketException: Connection reset
  1. Usually happens when receiving access point experience performance issues
  2. Resolved by retrying later
  3. If problem persist, notify the receiving accesspoint ot see if there are known issues
java.lang.IllegalStateException: The Oxalis server does not seem to be running at https://peppol.nets.no/oxalis/as2
  1. Receiving AccessPoint is down, could be maintenance
  2. Resolved by retrying later

Non-existent receiver / documenttype combination in SMP

Typical exception and error message shown below.

java.lang.RuntimeException: Problem with SMP lookup for participant 9908:964966575 and document type urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:www.cenbii.eu:transaction:biitrns014:ver2.0:extended:urn:www.cenbii.eu:profile:biixx:ver2.0:extended:urn:www.difi.no:ehf:kreditnota:ver2.0::2.1
Caused by: eu.peppol.util.ConnectionException: Error reading URL data (404)
  1. Delivery of this message has to be cancelled
  2. Optionally contact receivers access point and ask if the receiver will be registered shortly

Receiving access point unable to receive

Typical exception and error message shown below

java.lang.IllegalStateException: AS2 transmission failed : The following headers were received:
date: on, 01 mar 2017 09:50:07 +0100
message-id: 8f58e6d6-e9d0-4b71-9b9c-9b43285f5ec4
subject: AS2 message from OXALIS
content-type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-1;	boundary="----=_Part_9_2022012779.1488358207846"
as2-from: APP_00000000000
as2-to: APP_99999999999
disposition-notification-to: [email protected]
disposition-notification-options: signed-receipt-protocol=required,pkcs7-signature; signed-receipt-micalg=required,sha1
as2-version: 1.0
host: ap.somewhere.no
connection: Keep-Alive
user-agent: Apache-HttpClient/4.5.2 (Java/1.8.0_111)
accept-encoding: gzip,deflate
content-length: 37908

The message sent to AS2 System id APP_0000000000 on Wed, 01 Mar 2017 08:49:54 +0000 with subject AS2 MDN as you requested has been received.
It has been processed 
The warning/error message is :
ERROR: Unable to get content of message.can't extract input stream: java.io.IOException: No space left on device
  1. Manually decode the message to assess if it is any temporarily issue or permanent
  2. In this example it seems to be temporarily ("No space left on device"), safe to resend when problem has been fixed

vefa-srest's People

Contributors

steinarcook avatar klakegg avatar teedjay avatar bjornhilstad avatar

Stargazers

Even Schjølberg avatar

Watchers

 avatar James Cloos avatar  avatar Jon Arlov avatar Adam Mscisz avatar  avatar Rayner Vintervoll avatar Espen Kørra avatar  avatar

vefa-srest's Issues

Failing test testGetDefaultBillingScheme - billing should be excluded

testGetDefaultBillingScheme(no.sr.ringo.persistence.BillingRepositoryImplTest)  Time elapsed: 0.039 sec  <<< FAILURE!
java.lang.AssertionError: expected [9100] but found [0.00]
        at no.sr.ringo.persistence.BillingRepositoryImplTest.testGetDefaultBillingScheme(BillingRepositoryImplTest.java:72)


Results :

Failed tests:
  BillingRepositoryImplTest.testGetDefaultBillingScheme:72 expected [9100] but found [0.00]

$TOMCAT_HOME/conf/Catalina/localhost/vefa-srest.xml missing

Thanks for the packages but I can't seem to get the Basic Auth running properly...

The xml config file $TOMCAT_HOME/conf/Catalina/localhost/vefa-srest.xml is not being created when deploying the WAR.
Creating it manually then gives the following error at startup:

FAIL - Application at context path [/ringo-server] could not be started
FAIL - Encountered exception [org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the [/ringo-server] Context cannot be started.]

statistics sql should not include statement terminator

The /statistics resource fails with ORA-00933: SQL command not properly ended when using Oracle.

This is because the SQL string includes a statement terminator. Unsure if this also is a problem on other databases.

If PeppolMessageRepositoryImpl is changed from this:
final String orderBy = "\nORDER BY account.name ASC; ";
to this:
final String orderBy = "\nORDER BY account.name ASC";
it works on Oracle.

Select count() for /inbox resource is not portable

The SQL query that selects the number of inbound messages eligible for the /inbox resource, contains criteria, which are not portable to other databases like for instance Oracle.

Furthermore, all messages shall have a message_uuid henceforth there is no need for any criteria on this column.

select count(*) from message where account_id=1 and direction= 'IN' and delivered is null and message_uuid is not null and message_uuid != ''

"You do not have access to view this resource."

I get a "You do not have access to view this resource." message after giving the Basic Auth login.
I am running on a separate server (not localhost).

There are no errors in the logs apart from the below after trying to access the ringo-server

11-Mar-2018 18:02:45.494 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/admin/*] only the HTTP methods [GET] are covered. All other methods are uncovered.
11-Mar-2018 18:02:45.494 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/register/*] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
11-Mar-2018 18:02:45.494 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/*] only the HTTP methods [HEAD DELETE POST GET PUT] are covered. All other methods are uncovered.
11-Mar-2018 18:02:52.705 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
11-Mar-2018 18:02:52.712 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
11-Mar-2018 18:02:52.713 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@4b91ac30')

sr [11/Mar/2018:19:37:22 +0000] "GET /ringo-server/ HTTP/1.1" 404 44

Ordinary building should be possible without sertificates etc.

mvn clean install should work on a blank machine.

Integration tests requiring certificates, internet connection etc. should be activated by a profile.

When excluding tests by including them in an excluded group, remember to also include the @BeforeXxx annotated methods.

Way of getting generated keys not compatible with Oracle

Have been testing vefa-srest with Oracle 12c as database.
For instance POSTing to /outbox fails with a java.lang.NumberFormatException because Oracle returns generated keys differently than for instance mysql.

Have been able to POST to /outbox after changing this a little.
Instead of code like this which is used today:
PreparedStatement insertStatement = connection.prepareStatement(INSERT_INTO_MESSAGE_SQL, Statement.RETURN_GENERATED_KEYS);

I used something like this:
PreparedStatement insertStatement = connection.prepareStatement(INSERT_INTO_MESSAGE_SQL, new int[] {1});

Changed this in MessageRepositoryH2Impl.createMetaDataEntry and QueueRepositoryImpl.putMessageOnQueue to get POST /outbox to work.

I have not tested if this change also works on other databases. If it works for other databases as well, this change must be made more places than I have listed in the examples above.

[Code: 102, SQL State: S0001] Incorrect syntax near ')'.

The SQL being executed when performing http GET on /statistics gives syntax error in Oracle and MS SQL Server.

  1. Using SUM() for counting gives wrong results
  2. Current use of logic predicates inside the aggregate functions is considered invalid by many systems.
  3. The GROUP BY fails.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.