What mean ERROR message in JBoss 7.1, Seam Web Project - jboss

I try to deploy Seam Web Project and I have dwo errors:
135 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015010: The deployment scanner found a directory named META-INF that was not inside a directory whose name ends with .ear, .jar, .rar, .sar or .war. This is likely the result of unzipping an archive directly inside the D:\Karolina\programy\jboss-as-7.1.1.Final\standalone\deployments directory, which is a user error. The META-INF directory will not be scanned for deployments, but it is possible that the scanner mayfind other files from the unzipped archive and attempt to deploy them, leading to errors.
135 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015010: The deployment scanner found a directory named WEB-INF that was not inside a directory whose name ends with .ear, .jar, .rar, .sar or .war. This is likely the result of unzipping an archive directly inside the D:\Karolina\programy\jboss-as-7.1.1.Final\standalone\deployments directory, which is a user error. The WEB-INF directory will not be scanned for deployments, but it is possible that the scanner mayfind other files from the unzipped archive and attempt to deploy them, leading to errors.
Enyone know what it mean and what should I do to fix it?
I will glad for any answer.

The error message says that you are most likely trying to deploy a so called exploded archive, but exploded archive support has changed in JBossAS7.
Java EE 6 has made many xml deployment descriptors optional, which was a big win for devs, but app-server like JBoss had to change their way of identifying archive types, because now they can't rely on checking files/dirs for presence of xml descriptors.
You can find more details in docs.

Related

how to download war files from wildfly 8

Wildfly 8:
Where are the deployed war files located on the server file system?
How do I download them? I tried using the JBoss CLI as well as the Web Interface.
Found the war files to be located here. In this directory I found several subdirectories. The war files were all named content and did not have an extension. I could figure out what they were based on file size and timestamp.
wildfly location\standalone\data\content
You want the files 'after' they have been deployed? This generally isn't a good idea as it isn't guaranteed to be exactly the same as the source archive.
The standard location for the deployment archives is ./standalone/deployments/ although this can be changed in the configuration.
After an archive is deployed you can see the exact location of there the deployed archive came from in the configuration, it will be written to the bottom of the xml file.
There is a download button to download the .war
in the management console localhost:9990
click the view button near your war
on top you will find a download icon
I found it in the %WILDFLY_HOME%\standalone\temp\ directory. If it is not present there then you can perform a search in all the subdirectories of the wildfly.

Why do files end up in JBoss tmp but not the deployment

I have a JBoss server whereby when I deploy my ear file from Eclipse, I'm ending up with a whole bunch of jar files missing from the lib/ directory. Upon further investigation, I have found these files - they're in the JBoss server's tmp/vfs-nested.tmp directory. The timestamps all confirm that they're "fresh" from the latest Eclipse server instance publish action I kick off, but I'm perplexed as to why they're residing in this tmp directory and not in the application's (failed) deployment to the server.
JBoss documentation indicates "The tmp directory is used by JBoss to store temporarily files such as unpacked deployments." but I'm unsure as to what the order is or why things are there but not in the deployed application.
Any help?
Dave

How to clean JBoss AS 7.1.1 in IntelliJ + JRebel

I recently stated using IntelliJ + JRebel and like it so far.
There is just one thing which is kind of annoying. You can't see the content of the JBoss deployment directory as you can for Eclipse (where you see all files currently deployed).
As far as I understood IntelliJ is starting JBoss in a specific way that it points to the directory were the archive (ear/war/whatever) is compiled to.
But now I am facing a problem that IntelliJ seems to have an old version of my war somewhere (I can't find it in the target folder where the war is created), and tries to deploy my app twice.
I get the following error
14:10:55,111 INFO [org.jboss.as.server.deployment:66] JBAS015876: Starting deployment of "B-webapp.war"
14:10:55,111 INFO [org.jboss.as.server.deployment:66] JBAS015876: Starting deployment of "A-webapp.war"
14:10:55,113 INFO [org.jboss.as.server.deployment.scanner:266] JBAS015012: Started FileSystemDeploymentService for directory /Users/macbook15/jboss-as-7.1.1.Final/standalone/deployments
after that I get a failure that JBoss can't find the war for webapp B
14:10:55,159 ERROR [org.jboss.msc.service.fail:94] MSC00001: Failed to start service jboss.deployment.unit."CRF-webapp.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CRF-webapp.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "CRF-webapp.war"
pointing that it can't find the war file
Caused by: java.io.FileNotFoundException: /Users/macbook15/Downloads/repo.hg/naiis-webapp/target/CRF-webapp.war (No such file or directory)
Is there any cache held in IntelliJ or another place were this information (that there is another app to deploy) might be still stored.
Thanks for any help
Depending on standalone or deployment configuration that you are using, the war file may be sitting in the respective content directory. Check the question related to content directory here Also check the last segment stanalone.xml or domain.xml which will have information on the content directories.

Improving startup time for java web application in glassfish 3.1

I am trying to reduce the start up time of my web application deployed in glassfish 3.1.1 (build 12) application server. My web application is deployed as a war file containing multiple jar files for every module in the application. The jar files are located in the WEB-INF\lib directory.
On enabling detailed logs for glassfish, I saw that glassfish tries to search the class files in WEB-INF\classes and does not find it. Since there are more than 16K classes there is an error message for every class file.
|FINE |org.apache.naming_.FileDirContext| 88|PWC4451: File cannot be read E:\glassfish3.1.1\glassfish\domains\domain1\applications\mywebapp\WEB-INF\classes\com.xxx.yyy.MyClass.class
I added a emtpy jar named all-jars.jar in WEB-INF\lib and it contains a MANIFEST.MF file with a classpath attribute. The Class-Path attribute looks as below.
Class-Path: WEB-INF/lib/a.jar WEB-INF/lib/b.jar WEB-INF/lib/c.jar
Adding this jar didn't help though.
How can I tell glassfish to not search in WEB-INF/classes directory? Also any other suggestions to reduce the start up time?

Deploy war file with modifiable properties files

I am building a web service and am packaging it into a war file for deployment. Right now all of my config files (.properties and .xml) are being packaged into my .war file. This isn't going to work as some of these files will need to be modified for each individual installation. I know that some servlet containers will leave the .war files intact which would mean the config files would never be easily modified. My question is this: what is the best practice for deploying a .war file with these external config files? I'm thinking that the config files will need to be shipped separate from the .war file and placed into a directory that is in the classpath. Is there a default directory setup like this in Tomcat that these files can just be dropped into and my web service will be able to find without much trouble?
Maybe I shouldn't be using a war file for this setup? Maybe I should just be providing a zip file (with the same contents as the war file) and the deployment will simply be to extract the zip into the webapps directory?
I do not know any default directory in Tomcat to store configuration, my
attempts to solve the same issue have been :
1 - Move configuration to the DB and provide scripts or webpages to modify values.
2 - Have a script to deploy the war. The script would merge configuration from a user directory into web.xml or other deployed config files.
3 - Have webapps look first in a user directory for configuration and
if not found then look for configuration files deployed by the war.
Least favorite is 3 - it require all webapps to check two places for configuration and
you end up with two different xml files on the server with different values and it is not always clear which one is used.
Next favorite is 2 - the webapps can be written without knowledge of multiple config files, but you run into issue when someone does a deploy from Tomcat manager instead of using your script.
Favorite is 1. This just works in most cases. Problem is when you don't have a DB or
want to configure how you connect to the DB.
If having the file visible from all webapps is not an issue, you could put it $CATALINA_HOME/lib.
One solution is to modify property file after deployment of war file is to use ServletContext.getRealpath() method to get the real path means path of file in the server where it is deployed and then modify that file it will modify file in container only not the original file. So you need to backup it if it is important modification for you. So by this you do not need to redeploy war file as it is already modifying file from deployed container.
This solution can edit a file that is in webpages folder also from the java class.
If you want more description or how to do it then let me know i have did it.