Install4j Prompt user to specify port number to run JBoss Server - jboss

I have created a installer to Deploy my web application on JBoss server what I does as follows
Files
HSQLDB Database folder.
JBoss folder including my application war file.
Launcher
In this section I have created two launchers
first to unzip/extract the given Directories (Generated Launcher)
another launcher to execute standalone.sh file of my JBoss server
(External Launcher)
Installer
here I have added 3 Action
to change the access mode of standalone.sh and
server.log file
Execute Launcher action to start JBoss server
when I run the installer then every thing works fine and it will start my JBoss to but problem is JBoss by default run on port 8080 thus if this port in use then it will not start my JBoss server now what I wanted to do is that
prompt user to specify the port number on which JBoss will run
give alert message after completion of installation process.

You can ask the user for the port value with a configurable form:
Select the installer node, and click on the add button, then on "Add screen" and choose the "Configurable form".
Add a "Text field with integer format" form component to ask for the port. The form component saves the user input to an installer variable, say to "jbossPort".
Use a "Replace text in XML files" action to change the port in the XML configuration file of JBoss. The port value is referenced like this: ${installer:jbossPort}, it is also available from the variable chooser (small arrow next to all text fields, select "Insert installer runtime varaiable", then select the "Bound variables" tab).

Related

Restricting access to particular URL for sesame server deployed on JBoss (WildFly 8.2)

I have a sesame server running deployed in a WildFly 8.2.0 final container.
How can I restrict access to some particular URLs?
I know I have to edit some XML files (deployment descriptor and some other files) but I don't know which files and where to find them.
I figured it out my self.
Step 1:
Open the openrdf-sesame.war with Total Commander or any file archiver. Go the WEB-INF folder and open the web.xml file.
Edit the web.xml file by adding constraints, roles and the login-config tag as in this example : http://www.rivuli-development.com/further-reading/sesame-cookbook/basic-security-with-http-authentication/
Save the edited file within the archive and redeploy the openrdf-sesame.war file containing the modified web.xml file.
Step 2:
Go to the WildFly folder and enter the bin directory and run the add-user.bat file.
Choose b) Application User and hit Enter.
Enter a username and a password for the new user.
When you are asked "What groups do you want this user to belong to?", type in one of the roles you have created in the web.xml file and hit Enter.
When asked “is this new user going to be used for one AS process to connect to another AS process?” type “yes” and hit Enter.
And that's all.
You now have youre particular URL's restricted.

Generate code from deployed files

I had mistakely deleted my web services code. I don't have any backup of this code. Tried some file recovery tools but it didn't work. I have deployed the project in glass fish 4.0 server and the application works fine from there. So I am thinking is there any way I can generate the codes of that webservice?
Thank you
If you have the application deployed in your glassfish server then it is possible. You can always find your the .class files of original codes (not the one compiled by SEI) inside your domain folder of glassfish. Then you can use some third party tools to generate java codes from the class files. There are to ways that you can deploy your application in the glass fish server:-
By using the glass fish server web GUI and deploy it.
By using exernal IDE like eclipse where you create the glassfish server and deploy it.
For condition 1, goto :-
glassfish\domains\domain1\applications\__internal
where domain1 is your domain name. By default it is the name of your domain
For condition2, goto:-
glassfish4\glassfish\domains\domain1\eclipseApps
where domain1 is your domain name. By default it is the name of your domain
You can find your java codes inside WEB-INF\classes inside your project name.
Hope this helps.

deploy adempiere project .war file on jboss server

How To deploy Adempiere project .war file on jboss server?
Kindly describe the steps briefly.
Manually Adempiere deployment is some what more complicated. You can't find the only one specific .war file in adempiere.
If you are going to do adempiere manually deployment then you need to find the following
*.jars and *.wars from source and place the jars and wars in respective places in jboss application server
webui.war
adempiereApps.war
adempiereRootBase.war
Adempiere.jar
AdempiereApps.jar
AdempiereRoot.jar
CCTools.jar
CSTools.jar
CompiereJasperReqs.jar
Generating the Adempiere Installer :- (You can download adempiere installer from sourceforge also)
Adempiere already integrated with jboss 4.2.3. For getting adempiere installers sake you need run the *ADEMPIERE_Trunk/utils_dev/build.xml* using ant. then system will craete installers for you. These installers are available *ADEMPIERE_Trunk/adempiere/install*.
Now copy these installer (.zip or .tar.gz) and place into your desired server location and extract it. Ex :-( C:\Adempiere or /home/user/Adempiere, this path we called as ADEMPIERE_HOME)
To Configure Adempiere server :-
open up a console window and go to the $ADEMPIERE_HOME/ directory. Run the script RUN_setup(.bat or .sh depending on your OS), Now it will open a popup enter your data (related to database configuration , application server configurations and ports) and click on the OK button. after 1 to 2 Minutes the process will be completed.
To Run Adempiere server :-
To run the ADempiere Server from a console, open up a console window and go to the $ADEMPIERE_HOME/utils directory. Run the script RUN_Server2 (.bat or .sh depending on your OS).
Now you can access from browser.

Configure the path (localhost) of the war application to be the root (Java EE)

I want to change the path when I run my war-application locally...
Right now, it is running on the default setting...
http://localhost:8080/myproject-war/
and I want it to be the root, something like:
http://myproject-war.local/
or
http://myproject:8080/
How can I do that???
Note: My app is a Java EE 6 Application with Glashfish using Netbeans 7.3
This post helped me out How do you deploy a WAR that's inside an EAR as the root (/) context in Glassfish?.
First, I added a Standard Deployment Descriptor (application.xml) to the Enterprise Application Project.
Then, change the path of the context root of your web application: <context-root>/myproject-war</context-root> to <context-root>/</context-root> or <context-root />
Finally, (optional) remove or rename the Glashfish index page (or redirect it to the welcome page). located in the Glashfish default folder such as C:\Program Files\glassfish-3.1.2.2\glassfish\domains\domain1\docroot
Now the page web application will be visible on: http://localhost:8080/
Maybe you are mixing up stuff here - one thing you can and should do is setting the context root of your application. This is done in the server's deployment descriptor - in your case in glassfish-web.xml:
<context-root>/myproject</context-root>
(See The Java EE 6 Tutorial for more details.)
What you're asking in your example URLs is changing the host name, which is not related to your application or application server, but to your machine and OS settings.
You may put something in the OS hosts file (/etc/hosts on Linux, C:\Windows\System32\drivers\etc on Windows), but I don't see the point to do this. Your application runs on some host (may it be localhostor some external server) and this is how your URL starts.
you can put entry in host file. which is located in "C:\WINDOWS\system32\drivers\etc".
127.0.0.1 your_project_name

eclipse error: glassfish\domains\domain1 does not exist

I have java ee6 web profile sdk & I am using eclipse ee. I installed Glassfish plugin for eclipse using Download additional server adapters in the New Server wizard. Now during building a test app, eclipse raise this error glassfish\domains\domain1 does not exist. Whats the reason & how can I remove it?
Either your eclipse glassfish plugin points to the wrong domain or your server has no domain although there should be at least a default domain which is usually named domain1.
Check what's the name of your domain in glassfish-install-dir\glassfish\domains directory. If there is no subdir, you can create a domain with the asadmin tool:
glassfish-install-dir\bin\asadmin create-domain your-domain-name
See this description of the create-domain command.
If you already have a domain with a different name than domain1, you have to reconfigure your eclipse glassfish plugin. (Since I don't use eclipse, I can't take you any further. But I remember a BalusC tutorial on this topic).
Go to <Glassfish-install-directory>/glassfish/config directory.
Edit asenv and point to your JDK installation for set AS_JAVA=C:\Java\jdk.
Now you should be able to run asadmin.
Create a new domain using asadmin create-domain domain1 (inside bin directory).
Server setup in eclipse will now find your newly created domain.
I ran into this same problem and fixed it with the following:
Open a command prompt and browse to C:\glassfish3\glassfish\bin (or whatever your glassfish directory is)
Execute asadmin
Type in create-domain --adminport 4848 domain1 (your debug port can probably be whatever)
Go back into Eclipse and continue
Although late reply, but may be useful to someone facing similar issues.
If no domain exists in your glassfish path i.e say C:\glassfish4\glassfish\domains\ then you can create a new domain in the same path as follows:
Navigate to C:\glassfish4\bin\ directory and double click on asadmin.bat. It will open a command prompt as asadmin >
Type the following command asadmin > create-domain --adminport 4848 domain1
Click Enter repeatedly to keep the default settings viz. username (admin) password and other things.
That's it. You will find the domain1 created under C:\glassfish4\glassfish\domains\ directory with all default configurations.
If want to create domain in another directory or want some more info then can refer Oracle Glassfish Reference Manual:
http://docs.oracle.com/cd/E19798-01/821-1758/create-domain-1/index.html
Eclipse doesn't have domain path setting for glassfish server. This error comes when domain path is not correct. Make sure when you run your application on eclipse give glassfish credentials user/password
In my case, the C:\glassfish4\glassfish\domains\domain1\config\ domain.xml was renamed to something like domain568912323464576456.xml, so I edited the file, leaving it as it supposed to be named and done, server started up again.
create a new domain with
asadmin create-domain myDomain
add the path of this new domain, if there is a message "domain is not valid", make the folder domains/myDomain/conf permission to not only the root. If there is the message "is not writtable" then open Eclipse as root and try again. This should be work in these cases.
You must to add a password to your admin user. Eclipse mistake. Eclipse doesn't recognise the domain without admin password.
When you create the domain, add a admin user and a password and Eclipse doesn't complain any more.