Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Exception in jersey path mapper bubbles up until top #2952

Closed
jerseyrobot opened this issue Oct 9, 2014 · 7 comments
Closed

Exception in jersey path mapper bubbles up until top #2952

jerseyrobot opened this issue Oct 9, 2014 · 7 comments

Comments

@jerseyrobot
Copy link
Contributor

Some specific illegal URLs cause Jersey to throw an exception that causes an error page to be displayed if no error-page element is defined in the web.xml. An example for a stack trace generated by this can be seen below (in this case the URL ends with an opening brace).
In ServletContainer:333 there is already a try/catch that catches UriBuilderException. I think that at this point we should also catch IllegalArgumentException. What do you think?

java.lang.IllegalArgumentException: Invalid syntax in the template "/service/v1/test/{". Check if a path parameter is terminated with a "}".
	org.glassfish.jersey.uri.internal.UriTemplateParser.parse(UriTemplateParser.java:258)
	org.glassfish.jersey.uri.internal.UriTemplateParser.<init>(UriTemplateParser.java:110)
   org.glassfish.jersey.uri.UriTemplate.createUriComponent(UriTemplate.java:1001)
	org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:961)
	org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:906)
	org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:871)
	org.glassfish.jersey.uri.internal.JerseyUriBuilder._build(JerseyUriBuilder.java:893)
	org.glassfish.jersey.uri.internal.JerseyUriBuilder.build(JerseyUriBuilder.java:810)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:330)
	org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
	com.aldiinternational.esb.framework.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:124)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by camann9

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to michalgajdos

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
camann9 said:
See pull request https://github.com/jersey/jersey/pull/114

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
@AdamLindenthal said:
Hi camann9,

thanks for creating the issue and the pull request.
As we are already in contact also on github, I am moving the issue to backlog for now.

Regards,
Adam

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Marked as fixed on Thursday, February 19th 2015, 8:30:48 am

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-2680

@jerseyrobot
Copy link
Contributor Author

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant