jakarta-ee

file download via http post is returning the zip file contents

杀马特。学长 韩版系。学妹 提交于 2021-01-28 07:33:00
问题 I could see many related topics, but I have a specific problem. I am using spring boot controller to download a zip file. I am able to download the file when it is http verb get, but as I have to pass a big json payload I changed to post. Since then instead of downloading it as file it is responding the contents of the file with some ascii characters. Below is the method in controller for downloading the file. @ApiResponses(value = { @ApiResponse(code = 404, message = "file could not be found

Unable to lookup resource on component level in Websphere

烂漫一生 提交于 2021-01-28 07:32:01
问题 At the moment I'm working on an application that has to use a connection factory. When I lookup the connection factory directly on a global level by the name set in WAS everything is working fine, but for means of decoupling I want to define a resource reference in my application and lookup that name. So I created following entry in my application.xml: <resource-ref> <res-ref-name>jms/connectionFactory</res-ref-name> <res-type>javax.jms.ConnectionFactory</res-type> <res-auth>Container</res

GET request fails with JAX-RS: Could not find MessageBodyWriter for response object of type: java.util.ArrayList of media type: text/html

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-28 05:55:22
问题 I'm building a sample client-server with JAX-RS using JEE7. I'm using Wildfly 10.1 I followed the guy in this video. Here is the code of the war that runs on the application server: boundary package contains the service package pl.devcrowd.virtual.business.chickens.boundary; import java.util.List; import javax.ejb.Stateless; import javax.inject.Inject; import pl.devcrowd.virtual.business.chickens.controls.ChickenStore; import pl.devcrowd.virtual.business.chickens.entity.Chicken; @Stateless

“Already connected” Exception when running jersey application inside docker container

*爱你&永不变心* 提交于 2021-01-28 04:07:20
问题 I am trying to dockerize a jersey application which acts both as a REST server and client. The application seems to behave differently when running inside a docker container. I am able to perform a request to a non-dockerized service (A). The problem occurs when I try to perform a request on another non-dockerized REST server (B), using, in both cases, JAX-RS client API: // common code - for contacting both A & B services private static final Client client = ClientBuilder.newClient().register

Are JSP scriptlets an antipattern? [closed]

人走茶凉 提交于 2021-01-28 02:35:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I hope you understand the question. What do you think? If I post some code here with scriptlet I'm convinced that you're going to tell

my GlassFish Server, deploy, null, false

。_饼干妹妹 提交于 2021-01-28 00:15:13
问题 In my GlassFish Server, I got this error message: In-place deployment at D:\simpers\simpers\simpers-war\build\web<br> GlassFish Server, deploy, null, false<br> D:\simpers\simpers\simpers-war\nbproject\build-impl.xml:1118: The module has not been deployed.<br> See the server log for details.<br> BUILD FAILED (total time: 5 seconds)<br> 回答1: I got the same problem. Check you log and verify if it throws a missing Jar exception, that was my problem. For example, this was the log file Caused by:

Are activation specs required for message-driven beans?

流过昼夜 提交于 2021-01-27 18:56:24
问题 I have a non-JMS MDB that I'm installing into a Websphere Liberty server. package mdb.test; import javax.ejb.MessageDriven; @MessageDriven() public class TheMDB implements MyOwnListener { public TheMDB() {} @Override public void onMyOwnMessage(MyOwnMessage message) {} } Without further configuration, the server gives the following message: [WARNING ] CNTR4015W : The message endpoint for the TheMDB message-driven bean cannot be activated because the mdb.test/TheMDB activation specification is

Payara5 Server will not deploy: Unknown Protocol RFB

放肆的年华 提交于 2021-01-27 14:41:23
问题 In a clean eclipse environment payara5 will not deploy. I have downloaded the correct version of the server, using java 1.8 and simply added it with new server to start it. I cannot get rid of this error. The payara landing page works, however administrative console timeouts. Any help aprreciated. 2019-10-23T13:13:32.432+0200|INFORMATION: Running Payara Version: Payara Server 5.193.1 #badassfish (build 275) 2019-10-23T13:13:32.438+0200|INFORMATION: Server log file is using Formatter class:

SOAPMessage writeTo without attachment

可紊 提交于 2021-01-27 06:14:05
问题 I use SOAPMessage.writeTo(OutputStream) to log web service messages. A problem is that it also writes attachments. It is space consuming and the binary attachments are not readable . Is there any way how to log the message without attachments, e.g. a wrapper? There must be a better solution than this one. ByteArrayOutputStream out = new ByteArrayOutputStream(); message.writeTo(out); StringBuilder builder = new StringBuilder(out.toString()); int indexOfAttachment = builder.indexOf("------=");

How to get the client IP address in a JAX-RS resource class without injecting the HttpServletRequest?

岁酱吖の 提交于 2021-01-24 12:09:40
问题 We are using JAX-RS 1.0 and I want to get the client IP address in my resource class. Currently I inject the HttpServletRequest as a method parameter and then get the IP address. I want to make my code cleaner. I am thinking if I can use a MessageBodyReader class and set the IP address. But if I use a MessageBodyReader I have to unmarshall the XML to a Java object which is additional logic as far as I believe. Can anyone please let me know how to get the client IP address without having to