How to change jboss timezone?Java property is not working - jboss

it seems the jboss is using dates as UTC, I verified this by simply doing:
log.info(new Date());
And I get the UTC time.
So, in order to change it I added to standalone.conf the following property:
-Duser.timezone=Europe/Rome
But it's still not working!
Any other idea?

Just complementing Panagiotis answer:
<system-properties>
<property name="user.timezone" value="GMT"/>
</system-properties>
For Standalone
Linux/Unix: add to the user.timezone system property in standalone.conf
Microsoft: same thing but on standalone.conf.bat file.
Cli command to change the timezone
Or even set as JVM parameter directly:
./standalone.sh -Duser.timezone=UTC
To verify
/core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)

Try to add the user.timezone as a system property in standalone.conf :
.
.
.
<system-properties>
<property name="user.timezone" value="GMT+03:00"/>
</system-properties>
.
.
.

Related

Output in txt format in JasperReports Server

I'm using JasperReports Server 6.4.2. And in "Output Options" tab of "New Schedule" windows I have such list of output formats:
And I would like to add here .txt format. I uncommented the following line in \JasperReports Server\apache-tomcat\webapps\jasperserver\WEB-INF\flows\viewReportBeans.xml file:
<!--
<entry key="txt" value-ref="txtExporterConfiguration"/>
-->
and uncommented the lines:
<!--
<bean class="com.jaspersoft.jasperserver.war.dto.ByteEnum">
<property name="code">
<util:constant static-field="com.jaspersoft.jasperserver.api.engine.scheduling.domain.ReportJob.OUTPUT_FORMAT_TXT"/>
</property>
<property name="labelMessage">
<value>report.output.txt.label</value>
</property>
</bean>
-->
in \JasperReports Server\apache-tomcat\webapps\jasperserver\WEB-INF\flows\reportJobBeans.xml file, but these actions didn't make any visual effect, the "Text only" format didn't appear on the "Formats" form. How to add this format on the form?
I found also the similar question on the official jasper site, but, unfortunately, without answer... It seems the matter is in 6.x version.
At last I found instruction how to do this. The steps that I lacked: editing \JasperReports Server\apache-tomcat\webapps\jasperserver\scripts\scheduler\view\editor\outputTabView.js file and disabling "javascript.optimize" property in WEB-INF\js.config.properties file. After these actions "TXT" checkbox eventually appeared on the form:

JBoss AS 7 deployment dilemma, eclipse vs standalone.bat

![enter image description here][1]I am using Eclipse plug-in to deploy my J2EE application on JBoss AS 7.
I made changes in JBOSS_HOME/bin/standalone.conf as well as in standalone.conf.bat, where I updated the JVM heap sizes.
If I deploy the application via eclipse, the modified JVM configuriation isn't applied during the server start up. However, when I start it, using the standalone.conf.bat the changes are reflected during the start up as expected.
Is there anything I'm missing that eclipse fails to pick up?
Here is how the standalone.conf reads:
#JAVA=""
if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"
fi
# Uncomment the following line to prevent manipulation of JVM options
# by shell scripts.
#
#PRESERVE_JAVA_OPTS=true
#
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true - Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 - Dsun.rmi.dgc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS - Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.default.config=standalone.xml"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi
standalone.conf.bat:
if not "x%JAVA_OPTS%" == "x" (
echo "JAVA_OPTS already set in environment; overriding default settings with values: %JAVA_OPTS%"
goto JAVA_OPTS_SET
)
rem # JVM memory allocation pool parameters - modify as appropriate.
set "JAVA_OPTS=-Xms64M -Xmx512M -XX:MaxPermSize=256M"
rem # Reduce the RMI GCs to once per hour for Sun JVMs.
set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 - Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true"
The eclipse runtime clearly points to c: where i have done the edits to configuration files
![Eclipse Image]: http://i.stack.imgur.com/Mdq8d.jpg
You can specify heap size in VM arguments within eclipse.
Double click on Server-> Open Launch Configuration -> enter heap size in VM argument.
Since there is no other answer yet, here's my assumption.
Did you made the changes directly under the JBOSS_HOME/.... or in Eclipse for the JBoss instance? For any reason you can't make the changes under
Eclipse -> Server -> JBoss7_Runtime -> Filesets -> Configuration File -> standalone.xml
This is different from the Tomcat instance, where it is usual to edit the server.xml configuration file in eclipse as well. May be there is a workaround for the JBoss runtime, so that you can edit the config in eclipse too.

Redgate SQLCOmpare 6 Command Line => Return Code is "0" even DB's are identical

We have a NANT scripts which are using for packaging automation.
We also comparing previous DB and current DB if any structural and Data changes with SQLCompare command line tool.
Even I compare same database, I can't get exit code "63" which means "two databases are identical". I am getting always exit code "0".
How can I control if DBs are identical or not ?
NANT Scripts for SQLCompare :
*<property name="remcom.machine" value="server"/>
<property name="remcom.user" value="${server.user.administrator}"/>
<property name="remcom.pwd" value="${server.password.administrator}"/>
<property name="remcom.workdir" value="${sqlcompare.dir}"/>
<property name="remcom.command"
value=""${sqlcompare.file} /s1:${compare.db.instance} /u1:${compare.db.user} /p1:${compare.db.pwd} /db1:${db.current} /s2:${compare.db.instance} /u2:${compare.db.user} /p2:${compare.db.pwd} /db2:${db.previous} /f /q /sf:e:\redgateReports\${script.file} /r:e:\redgateReports\${report.file} /rt:Interactive /options:IgnoreWhiteSpace,IgnoreFillFactor,IgnoreFileGroups,IgnoreUserProperties,IgnoreWithElementOrder,ForceColumnOrder,IgnorePermissions,NoSQLPlumbing""/>
<call target="RemoteCommand"/>
<property name="sqlcompare.exitCode" value="${remcom.result}"/>*
THIS IS THE CODE WHICH I AM CONTROLLING THE EXIT CODE :
<property name="compare.failed" value="${sqlcompare.exitCode != '63'}"/>
<if test="${property::exists('failIfDifferent') and failIfDifferent == 'true'}">
<fail if="${compare.failed}" message="Exit code is NOT 63. DB stuctures [ ${db.current} and ${db.previous} ] are NOT identical. see report files in server: ${report.file} " />
</if>
Thank you for response. I tested my sqlcompare command on my local machine . It didn'T give me "63" code. Then I create a comparison project with sqlcompare and used same options in my command line option list
Then it worked fine and now I will test it in our NANT scripts and server.
Best Regards.
Ali Bulut

First run notepad with my.cfg and only then start the service

I install along with my application:
1) a service that starts and stops my application as needed
2) a conf file that contains actually the user data and that will be shown to the user to modify as needed (I give the user the chance to change it by running notepad.exe with my conf file during installing)
The problem is that in my code the service I install starts before the user had the chance to modify the conf file. What I would like is:
1) first the user gets the chance to change the conf file (run notepad.exe with the conf file)
2) only afterward start the service
<Component Id="MyService.exe" Guid="GUID">
<File Id="MyService.exe" Source="MyService.exe" Name="MyService.exe" KeyPath="yes" Checksum="yes" />
<ServiceInstall Id='ServiceInstall' DisplayName='MyService' Name='MyService' ErrorControl='normal' Start='auto' Type='ownProcess' Vital='yes'/>
<ServiceControl Id='ServiceControl' Name='MyService' Start='install' Stop='both' Remove='uninstall'/>
</Component>
<Component Id="my.conf" Guid="" NeverOverwrite="yes">
<File Id="my.cfg" Source="my.cfg_template" Name="my.cfg" KeyPath="yes" />
</Component>
[...]
<Property Id="NOTEPAD">Notepad.exe</Property>
<CustomAction Id="LaunchConfFile" Property="NOTEPAD" ExeCommand="[INSTALLDIR]my.cfg" Return="ignore" Impersonate="no" Execute="deferred"/>
<!--Run only on installs-->
<InstallExecuteSequence>
<Custom Action='LaunchConfFile' Before='InstallFinalize'>(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE)</Custom>
</InstallExecuteSequence>
What am I doing wrong in the above code and how could I change it in order to achieve what I need? (first run notepad with my conf file and then start the service).
I would extend the MSI UI to ask for the parts the user needs to modify and then update the text file using XmlFile and XmlConfig elements. Then Windows installer can come by and start the service.

Deploy to remote server using scp in NANT script

I am trying to copy a file to a remote server using scp task in Nant.Contrib .
I have used the following code to do that:
<target name= "QADeploy"description="gthtyb" >
<loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />
<echo message="htyh"/>
<scp file="D:\SourceTest\redist.txt" server="\\10.4.30.19" user="xxx:uuuu">
</scp>
</target>
But I am getting an error: scp failed to start. The system cannot find the file specified.
The code is as follows:
Then I have downloaded pscp.exe and modified the code as below:
<target name= "QADeploy"
description="gthtyb" >
<loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />
<echo message="htyh"/>
<scp file="D:\SourceTest\redist.txt" server="\\10.4.30.19" user="xxx:uuuu" program="C:\pscp\pscp.exe">
</scp>
Now I am getting the following error:
[scp] ssh_init:host does not exist
External Program Failed:C:\pscp\pscp.exe
can u please help whats the best way to copy a file to a remote server using Nant. I am using this code to deploy files to a remote server.
Thanks
You don't have to put two backslashes behind the IP of your server.
<scp file="D:\SourceTest\redist.txt" server="10.4.30.19" user="xxx:uuuu" program="C:\pscp\pscp.exe">
Also note that without the "path" parameter, the default destination folder is "~".
Update: it is the username that is crashing the pscp.exe program. Remove the ":" from your username or try with a different one.
it seems like there is some weirdness on how pscp parses paths in windows. The following should fix ssh_init:host does not exist problem:
-upload
pscp some.file user#[remote-host-or-ip]:/some/path/
-download
pscp user#[remote-host-or-ip]:/some/path/some.file some.file