Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dropWizardVersion = "3.2.6"
easyMockVersion = "5.2.0"
freemarkerVersion = "2.3.32"
fusionAuthJWTVersion = "5.3.2"
javaHTTPVersion = "1.1.0"
javaHTTPVersion = "1.2.0"
jsonPatchVersion = "1.13.0"
guavaVersion = "32.1.2-jre"
guiceVersion = "6.0.0"
Expand All @@ -29,7 +29,7 @@ logbackVersion = "1.5.13"
slf4jVersion = "2.0.13"
testngVersion = "7.8.0"

project(group: "org.primeframework", name: "prime-mvc", version: "5.4.0", licenses: ["ApacheV2_0"]) {
project(group: "org.primeframework", name: "prime-mvc", version: "5.5.0", licenses: ["ApacheV2_0"]) {
workflow {
fetch {
// Dependency resolution order:
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.primeframework</groupId>
<artifactId>prime-mvc</artifactId>
<version>5.4.0</version>
<version>5.5.0</version>
<packaging>jar</packaging>

<name>FusionAuth App</name>
Expand Down Expand Up @@ -109,7 +109,7 @@
<dependency>
<groupId>io.fusionauth</groupId>
<artifactId>java-http</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<type>jar</type>
<scope>compile</scope>
<optional>false</optional>
Expand Down
4 changes: 2 additions & 2 deletions prime-mvc.iml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/.savant/cache/io/fusionauth/java-http/1.1.0/java-http-1.1.0.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/io/fusionauth/java-http/1.2.0/java-http-1.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/.savant/cache/io/fusionauth/java-http/1.1.0/java-http-1.1.0-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/io/fusionauth/java-http/1.2.0/java-http-1.2.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/primeframework/mvc/BasePrimeMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ public void start() {

// Create the server
var server = new HTTPServer().withConfiguration(config)
// Note that by calling each of these methods directly, we are functionally
// ignoring these three values on the configuration object provided by
// BasePrimeMain. This just means that the implementor cannot currently
// provide their own request handler, exception handler or instrumentor.
.withHandler(requestHandler)
.withUnexpectedExceptionHandler(new PrimeMVCUnexpectedExceptionHandler())
.withInstrumenter(instrumenter);

servers.add(new PrimeHTTPServer(requestHandler, server));
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/primeframework/mvc/PrimeMVCRequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.fusionauth.http.server.HTTPHandler;
import io.fusionauth.http.server.HTTPRequest;
import io.fusionauth.http.server.HTTPResponse;
import io.fusionauth.http.server.io.ConnectionClosedException;
import org.primeframework.mvc.action.result.MVCWorkflowFinalizer;
import org.primeframework.mvc.guice.GuiceBootstrap;
import org.primeframework.mvc.http.HTTPObjectsHolder;
Expand Down Expand Up @@ -69,14 +68,12 @@ public void handle(HTTPRequest request, HTTPResponse response) throws Exception
HTTPObjectsHolder.setRequest(request);
HTTPObjectsHolder.setResponse(response);

// Do not catch any exceptions, the HTTP server will handle exceptions.
// - If we do want to log or perform any specific handling when an unexpected
// exception is thrown, you may configure an UnexpectedException handler.
// See HTTPServerConfiguration.withUnexpectedExceptionHandler
try {
injector.getInstance(MVCWorkflow.class).perform(null);
} catch (ConnectionClosedException e) {
response.setStatus(408);
logger.debug("Connection closed. This is generally caused due to a timeout, or a slow connection.", e);
} catch (Throwable t) {
logger.error("Error encountered", t);
throw t; // java-http will cause this error to write back a 500 if possible and close the socket
} finally {
HTTPObjectsHolder.clearRequest();
HTTPObjectsHolder.clearResponse();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2025, Inversoft Inc., All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package org.primeframework.mvc;

import io.fusionauth.http.server.ExceptionHandlerContext;
import io.fusionauth.http.server.HTTPUnexpectedExceptionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author Daniel DeGroff
*/
public class PrimeMVCUnexpectedExceptionHandler implements HTTPUnexpectedExceptionHandler {
private static final Logger logger = LoggerFactory.getLogger(PrimeMVCUnexpectedExceptionHandler.class);

@Override
public void handle(ExceptionHandlerContext context) {
logger.error("Error encountered", context.getThrowable());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void get_classpath_resolution() {
simulator.test("/org/primeframework/mvc/PrimeMVCRequestHandler.class")
.get()
.assertStatusCode(200)
.assertContentLength(3188);
.assertContentLength(2613);
}

@Test
Expand Down