web-services,jboss,war,web-deployment,resteasy , JBoss REST WS application doesn't work when deployed as WAR file but works when expanded to a folder


JBoss REST WS application doesn't work when deployed as WAR file but works when expanded to a folder

Question:

Tag: web-services,jboss,war,web-deployment,resteasy

I am deploying an application on JBoss server (EAP-6.4.0, JBoss Web/7.5.7.Final-redhat-1).

I get a very strange behavior. Let's say the application is called Engine.war. The application implements a REST Web service server.

  1. When I deploy the application by copying the WAR file to c:\EAP-6.4.0\standalone\deployments\Engine.war file, it is successfully deployed, but doesn't work.

  2. When I deploy it by unpacking/extracting/exploding the content of the WAR file to c:\EAP-6.4.0\standalone\deployments\Engine.war folder and creating the Engine.war.dodeploy file, it is also deployed, but does work.

By doesn't work I mean that the server is complaining that

JBWEB000065: HTTP Status 404 -
JBWEB000124: The requested resource is not available.
JBoss Web/7.5.7.Final-redhat-1

so the same behavior like if you misspell the URI.

All the web resources I have found state that these two deployment methods are just equivalent alternatives, and for our other applications we do not observe any differences!

Can you see any reason why in just this case it is matters if I unpack the WAR file or not?


Answer:

We finally found the solution. It's pretty stupid so I want to post it to prevent others from losing their time...

We have found that there was a difference in the naming. The name of the unpacked WAR file was not just Engine.war as I stated in my question (I did it as I believed it would hide all the irrelevant details). The actual name was Engine-0.0.1-SNAPSHOT.war, but when I unpacked it I was lazy to write such a long name and I unpacked it to a folder named just Engine.war.

By default - unless specified explicitly otherwise - the application's root address is the same as the WAR file name, so for Engine-0.0.1-SNAPSHOT.war it was http://localhost:8080/Engine-0.0.1-SNAPSHOT.

However, we counted with address http://localhost:8080/Engine and it worked, as the Eclipse plugin always removed the version suffix from the unpacked folder and we did not realize that.

More detailed description here: http://www.openscope.net/2010/01/25/war-deployment-file-structure/.

So the whole "trick" was to add the proper WEB-INF\jboss-web.xml file with content

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web>
<jboss-web>
    <context-root>/Engine</context-root>
</jboss-web>

By the way, as another post says, you cannot do it in a server-agnostic way: http://stackoverflow.com/a/664089/2886891


Related:


java.lang.AbstractMethodError: org.jboss.arquillian.config.descriptor.impl.EngineDefImpl.getDeploymentExportExploded()Ljava/lang/Boolean;


java,jboss,spock,wildfly-8,jboss-arquillian
When I try to deploy my artifact during integration test I'm getting this error. @RunWith(ArquillianSputnik) class WebServiceTest extends Specification { @Deployment static WebArchive createDeployment() { ShrinkWrap.createFromZipFile(WebArchive.class, new File("target/project.war")) } } where arquillian.xml is: <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian...

How to deal with extra “/” in phpleague route?


php,web-services,routing
I am setting endpoints for my web application like this: $router = new League\Route\RouteCollection; function user_action (Request $request, Response $response) { // some logic . . . return $response; } $router->addRoute('GET', '/user', 'user_action'); /user endpoint works well. However when I use /user/ (extra slash in the end) I get a...

@Resource datasource breaking DB connection


java,jpa,jdbc,jboss,wildfly
I recently wrote a class, in my web application, for parsing a huge XML file and feed a db table with its content. My application is running on Wildfly9, and uses JPA with Hibernate provider to handle a MySQL DB. The AS configuration is pretty standard, I just added my...

Using client certificate with Apache Axis 1


web-services,tomcat,axis,client-certificates
Prerequisites Apache Tomcat 7 Spring 3.2.11.RELEASE Apache Camel 2.14.1 Apache Axis 1 (1.4) Keystore including client certificate (private key, public key etc.): my_keystore.p12 Question I am trying to access a remote rpc/encoded werbservice using Apache Axis 1. It is neccessary to use Apache Axis 1 because of rpc/encoded style of...

Accessing JSON elements in PHP


php,ios,json,xcode,web-services
PHP noob here. I am building an iPhone app that is sending JSON blobs to a web server. On the server side I am receiving the JSON and trying to access the 3 fields that the object contains. Two weird things are happening to me that I could not figure...

WCF Services In Background


c#,web-services,wcf
I'm trying to figure out how to run WCF Services as background Windows Services. So far, in all the examples I've seen, for either a REST-WCF Web Service Host or a Duplex WCF Service Host, they end up running a small console that starts up the interface/service and waits for...

Failed to execute goal on project. Unable to find POM in project


java,maven,jboss
I am trying to build an application having following dependency. <properties> <version.jboss.as>7.5.0.Final-redhat-21</version.jboss.as> </properties> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-jms-client-bom</artifactId> <version>${version.jboss.as}</version> <type>pom</type> </dependency> </dependencies> This is an example which i found on Red Hat Site -...

Spring service and Spring web app in one


spring,web-services,rest,spring-mvc,web
I'm making a Spring RESTFUL service and i wonder. Can I make a Spring RESTFUL service combine with a web app in a project. If it is possible, how to configure it? ....

Retrofit error: Expected BEGIN_ARRAY but was STRING


android,web-services,retrofit
In api response sometimes It can be array, sometimes it can be string. Here details is Array { "ts": "2015-06-16 11:28:33","success": true,"error": false,"details": [ { "user_id": "563", "firstname": "K.Mathan" }, { "user_id": "566", "firstname": "Surya" }, { "user_id": "562", "firstname": "Idaya" } ]} Sometimes details can be string { "ts":...

understand spring-ws, integration with spring-mvc and automatic generation of wsdl


java,spring,web-services,wsdl,spring-ws
i want learn spring-ws with automatic generation of wsdl files, i know that is a lot of tutorials, i tried them, my favorite example is : github projet It works well, but i tried to ajust that solution for my needs, and it doesnt work, i dont know why, and...

Why do we need to publish or deploy web services or WCF?


web-services,wcf
I am in the path of learning WebServices and WCF. So far I understand that webservice or Wcf contains web methods which can be consumed by client side or on the service side too. But my question is why do we need to publish/deploy a webservices or wcf in IIS...

Java-webservice: Glassfish3.0 error “org.codehaus.jackson.jaxrs.JacksonJsonProvider”


java,web-services,glassfish
While I restarting the Glassfish 3.0 server from NetBeans 8.0 after adding a RESTful web service, I got this exception and couldn't request the web service!! Glassfish 3.0: java.lang.ClassNotFoundException: org.codehaus.jackson.jaxrs.JacksonJsonProvider I checked the Maven Pom.xml for jersey dependency and the tag is already exist! <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>2.4.0</version> </dependency> ...

Wildfly Kafka clients module javax/management/JMException not found


java-ee,jboss,wildfly,kafka
I'm try to create Kafka clients module for Wildfly. Here is module.xml: <?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="org.apache.kafka.clients"> <resources> <resource-root path="kafka-clients-0.8.2.0.jar"/> <resource-root path="lz4-1.2.0.jar"/> <resource-root path="snappy-java-1.1.1.6.jar"/> </resources> <dependencies> <module name="org.slf4j"/> </dependencies> </module> Wildfly (8.2.0-Final) gives this error on boot:...

Not able to create a WCF RestFul Service's client


asp.net,web-services,wcf,rest
I am newbie with web services. I am trying to create a WCF Restful web service . I have implemented a simple service that accepts parameter name and when the client requests the service it prints hello with name. I have created a web client and added the reference of...

How to consume multipart/form data request in C# mvc 4 webservice


c#,asp.net-mvc,web-services,wcf,asp.net-mvc-4
I created a web service for file upload. When I call this webservice I can't find multipart-form data request. If I call this webservice without a file then it will working fine. My code is: Interface code: [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, Method = "POST", ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetStream")]...

.NET web service gets null object


c#,.net,ajax,web-services,rest
I'm trying to save an object using ajax call and .NET REST web service but I get null object on .NET side. Please help me to find out what's the issue. C# Object: [DataContract] public class Customer { [DataMember] public int Id { get; set; } [DataMember] public string Name...

Exclude Package From Gradle Dependency


java,web-services,rest,gradle
I'm experiencing an issue where multiple versions of the same class are showing up in my classpath. The class in question is javax.ws.rs.core.UriBuilder. The version I want to use is brought in by javax.ws.rs:javax.ws.rs-api:2.0.1. However, we also use the Jira rest client library which has a dependency on the older...

Sending Image From Android to C# webservice


c#,android,web-services,encoding,android-image
I'm sending image from Android to C# webservice. I always get a black image.Can anyone help? Android side: public void save(View v) { mBitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.RGB_565); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); mBitmap.compress(Bitmap.CompressFormat.JPEG,40, outputStream); byte[] imgByte = outputStream.toByteArray(); String base64Str = Base64.encodeToString(imgByte, Base64.DEFAULT); // Send base64Str to server }...

Failed to load resource: the server responded with a status of 421 (Bad Request)


javascript,html,ios,web-services,cloudkit
I am using Apple's new CloudKit JS reference and sample code to build a simple CRUD app. Before I can even get to CRUD however I am being stopped by Apple authentication. index.html <html> <body> <div id="apple-sign-in-button">Sign in <span id="username"></span> </div> <script> /* * Initialize the global objects we will...

Is communication via web services standardized among JavaScript on different browsers?


javascript,web-services
I'm new to JavaScript and want my JavaScript code to communicate with some server using JSON. Imagine I write a piece of code in pure JavaScript (no frameworks), which sends a request and receives a response. If this code works in Chrome, can I assume that it will also work...

Refactoring some legacy camel code, is this code unnecessary or am I missing something?


jboss,apache-camel,jbossfuse
I'm refactoring some apache camel legacy code in a JBoss Fuse instance and I've run into some code that I'm not sure what it's purpose is for. <when condition> <loadBalance id="someVar"> <failover roundRobin="true" maximumFailoverAttempts="3" /> <to uri="fabric:FABRICENDPOINT" /> </loadBalance> </when> I haven't used Fabric's load balancer before but from what...

Error deploying yii2-starter-kit Yii2 installation


web-services,yii2
I'm trying to deploy this Yii2 installation (https://github.com/trntv/yii2-starter-kit/blob/master/docs/installation.md#configure-your-web-server) but I'm having problems. I think problems are related with this configuration step: "Configure your web server". I've the webpage running here: http://vector5.raspctl.com/yii2-starter-kit/frontend/web/ But no one of the options works. For example, "Connect" option (http://vector5.raspctl.com/yii2-starter-kit/frontend/web/user/sign-in/login) I can't found the error, any help?...

AFNetworking GET Parameters in body


ios,web-services,afnetworking-2
I have the following code and I want to force the parameters to be in the body of the GET call and not part of the query string NSString * requestURL = [NSString stringWithFormat:kXXXBaseAPIURL,@"findfriends"]; NSString * lastCallTime = [[XXXCommon sharedInstance] lastTimestampForURL:requestURL]; AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; AFHTTPRequestSerializer * serializer =[AFJSONRequestSerializer...

Giving a prepared SOAP response by Java


java,xml,web-services,soap
I have a client, I want to make the server off by changing endpoint for exceptional situations and I want to give a prepared response for the request. As there are many security issues for preparing the SOAP messages, I don't want to make a complex fully completed (fake/mock) webservice...

How to deploy WildFly datasource with Arquillian?


java,jboss,integration-testing,wildfly-8,jboss-arquillian
I tried to deploy my datasource as follows: @Deployment(name = "test", order=2) static WebArchive createDeployment() { ShrinkWrap.createFromZipFile(WebArchive, new File("target/test.war")).addAsWebInfResource(new File("src/test/resources/test-DS.xml"), "test-DS.xml") } but it seems that my datasource is ignored, I see no info about deployment in jboss console. Is there any other possibility to deploy datasource with arquillian? @Deployment(name...

The remote server returned an unexpected response: (413) Request Entity Too Large.?


c#,web-services,wcf
I pass some values to my WCF service from the .net application in string format. Passing string format will be in this structure, ItemName~ItemDescription~ItemPrice|ItemName~ItemDescription~ItemPrice|... Every line item will be separated by '|' character. I was passing nearly 1000 items. It was working as expected, but when I came to pass...

Continuing with Spring integration flow after SoapFault


web-services,spring-integration,soapfault
Our application integration flow is defined as splitter -> ws gateway -> aggregator The splitter splits request into a list of account numbers; so that for each account number a web service call is initiated and the responses from multiple web service calls are aggregated in the aggregator.The channel between...

Can't save json data to variable (or cache) with angularjs $http.get


json,angularjs,web-services,rest
I have weird angularjs problem. I'm trying to fetch data from Rest Webservice. It works fine, but I can't save json data to object. My code looks like: services.service('customerService', [ '$http', '$cacheFactory', function($http, $cacheFactory) { var cache = $cacheFactory('dataCache'); var result = cache.get('user'); this.getById = function(id){ $http.get(urlList.getCustomer + id).success(function(data, status,...

Not Able to consume external RestFul web service from Client in Eclipse or from restclient-ui


java,eclipse,web-services,restful-url,rest-client
I am not able to consume RESTful webservice from client. I have written in eclipse, even not able to consume it from restclient-ui, but can access sample RESTful web service which is running in my location web logic server. I am in Corporate/company Network. Getting error Connection Time out exception....

error: cannot find symbol class AsyncCallWS Android


java,android,web-services
I'm trying to rewrite the application in this, in Android Studio link, which is written in Eclipse. There are two problems, first problem is there is this line in the project : import com.example.webserviceactivity.R; I couldn't write this one on Android Studio. The second problem is, in this part of...

Not able to hit 2nd services with generated Token


c#,web-services,rest,soap,drupal-services
I have been provided with two services in which ist service is used for login purpose and it will return an xml node token which i to be added as the header in all other services call, In the attached sample code there are two functions in function CreateObject() i...

HTTP 415 Unsupported Media Type


java,web-services,maven,jax-rs
I have created a sample web service to make a post call. I am using Jersey JAX-RS, and Maven. web.xml <servlet> <servlet-name>provider-serlvet</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> <init-param> <param-name>javax.ws.rs.Application</param-name> <param-value>org.is.ws.provider.rest.ProviderAggregateApplication</param-value> </init-param> <init-param>...

Can I throw a message fault back to a WCF client from a routing service


c#,.net,web-services,wcf,encryption
My company has long used ASPX and windows services through a routing program to manage the connections and allow our datacenters to control where the clients make connections. Just recently we started using MVC and WCF. Yes in 2015 we are just moving to these things. Anyway they figured out...

Can not send Captcha image through nusoap webservice


php,web-services,nusoap,simplecaptcha
I'm creating a Captcha session by createCaptcha function that i wrote. and in the webservice I call this function to create a Captcha session and image then I want to send Captcha image Or display created Captcha image by webservice that user can send it's value through webservice but I'm...

Call php from javascript


javascript,php,html,web-services,google-maps
I have an index.php which contains both JS and PHP code. The PHP code reads GPS coordinates from an iOS app and the JS reads these coordinates back to be displayed on a web app. I am stuck on figuring out how to call the PHP every few seconds so...

Consuming and exposing webservices in one project (.NET)


.net,web-services,rest,soap
What is best practice concerning consuming and exposing webservices in one project? (.net) I need to create a rest webservice to expose data. The rest webservice would need to consume this data from another (SOAP) webservice from a third party. (The data needs to be merged with data present in...

Valid “protocols” for HornetQ


java,jboss,jms,hornetq
I have some code like this for connecting to HornetQ. Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); properties.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447"); properties.put(Context.SECURITY_PRINCIPAL, "user"); properties.put(Context.SECURITY_CREDENTIALS, "pwd"); ConnectionFactory connectionFactory = null; Destination destination = null; try { Context context = new InitialContext(properties); I inherited this, and am trying to get a...

JAX-RS @FormParam one time for all methods


java,web-services,java-ee,jax-rs,java-ee-6
I am developing Java "JAX-RS" Web Services for books and contents. There will be 100s of URLs something similar ... https://api.example.com/v1.3/book1/chapter/1 https://api.example.com/v1.3/book1/chapter/2 ... https://api.example.com/v1.3/book1/chapterN To fetch the chapter content user needed to POST authToken, which I validate in server and return content or error. The sample code ... @Path("/book1") public...

Adding Acumatica Customer Contacts


web-services,acumatica
I am having problem adding customer contacts using web services, at first instance of integration my application successfully adds the contacts using web services. But when i re-integrate the same contact in the same customer it duplicates the previously integrated contacts instead of just updating them. I tried adding value...

How to load config.properties file in a Seam Application using web.xml context-param


jboss,seam,web.xml
I have a seam web application in which I have to include a security module for integrated authentication. I can see that the module isn't based on seam application because it uses a spring-like notation. As the module works defining a listener and a properties file in the web.xml I...

Spring Webservices gives 406 error


java,spring,web-services,spring-mvc
I have created a simple Spring with webservices example but when I try to get the response I am getting error as : HTTP Status 406 - The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers. This...

Is JSON better than XML? Which one is more secured? [duplicate]


android,json,xml,web-services,rest
This question already has an answer here: What is the difference between json and XML? [closed] 3 answers I'm very much clear about using JSON and XML, but still while comparing each other I cant find differences related to security. Which one is more secure? Which one I should...

Using Java web service on Amazon cloud


java,web-services,amazon-web-services,amazon-ec2
I want to make a web service in java which will take arguments and do processing and return a json response. I am not been able to figure out how to deploy this service on amazon ie (on ec2 or some where else) . what will be the url to...

How to add object to WSDL service system.array


c#,arrays,web-services,wsdl
I am currently working with a WSDL that has a method to save invoices. I have been able to modify existing invoices, but haven't figured out how to save new ones. Since the array size is immutable, I am unable to add objects to the array that is retrieved. How...

Save SOAP UI mock requests to a file


web-services,soap,request,soapui
I m using Soap UI basic version for some mocking. I need to persist my requests to some file. I just have generated mock services with some predefined input to output rules, and i searched on net and found this: def logArea = com.eviware.soapui.SoapUI.logMonitor.getLogArea( "http log" ); def groovyUtils =...

Android AsyncTask with JSON Parsing error


java,android,json,web-services,wcf
Error coming in this section: protected void onPostExecute(JSONObject json) { try { // Getting JSON Array user = json.getJSONArray(TAG_USER); JSONObject c = json.getJSONObject(0); String id = c.getString(TAG_ID); String name = c.getString(TAG_NAME); Log.i("id",id); } } ------- Webservice Result--- {"GetDataResult":{"ID":8,"Name":"Foo Bar"}} Working Link - http://127.0.0.1/WcfService4/Service1.svc/getData/?key=8 Provide the better solution for solving this....

How To find a WebSocket from a REST bean


rest,jboss,websocket
I have a javascript client that connects to a server via websockets and sends data via ajax to a server. Once the server finished processing the data, I want to send a message via the websocket to the client. Problem is: How do I find the WebSocket from the REST...

WebMethod having array as a parameter


asp.net,web-services
I want to write a web method having its one argument as an Array/List. The code builds successfully but on browser to test it shows following message. The test form is only available for methods with primitive types as parameters. [WebMethod] public string Concat(params string[] arr,int a,int b) { string...

Write a Java Program to connect to HornetQ Messaging Service in Jboss EAP 6.3?


java,jboss,jms,hornetq
I am using Jboss EAP 6.3 and need to use Messaging facility. I have worked in Jboss 4x, where we can make connection easily using following code: public static final String PROVIDER_URL = "jnp://localhost:5445"; public static final String JNP_INTERFACES = "org.jboss.naming:org.jnp.interfaces"; public static final String INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory"; private static...

Server side session in asp.net


asp.net,web-services,session
I want to set one value in server side session in client side and need to access that session in web service, so i tried below In client side : //Set the server side session like below var vr_="demo.png"; '<%Session["path"] = "' + vr_ + '"; %>'; //In alert,checked the...