Techno Triad

Three Geeks and a Single Blog

Tomcat not starting system error 1067

leave a comment »

After installation of tomcat some times while starting the service u get the 1067 error saying not able to start . the error itself is generic.

check the tomcat log files for any error.

Diff cases why this error might occur

1. the jre is  not set properly.

Sol: double click on the tomcat6w.exe in the java tab check in the jvm.dll is set to the proper value.if not select your jvm and try starting the tomcat.

2. inital heap not sufficient.

Sol: Got to registry( check if u r machine is 32 bit or 64 bit if 64 2 regedits are there check in C:\windows\syswow64\regedit).

click on HKEY_LOCAL_MACHINE\software\apache\tomcat\parameters\java  (path might change based on tomcat version)

modify the jvmMs option to a next higher value( if 256 to 512) and restart the tomcat. if this options dosent exist add it.

if no error is logged in the log files. go to event viewer (start\controlpanel\admin tools\event viewer) and in system ull find an error event stating the reason.

Written by sagarika

April 26, 2012 at 6:33 am

Java heap out of memory

leave a comment »

With data intrinsic solutions the most common error is Java heap out of memory exception. Its quite bad to see this exception in the log . Though you might see this that frequently in base products, but on production env its quite likely to occur because of huge data inflow. One option is to multithread your application and batch processing so that garbage collection will reduce the memory.

The best way is to increase the memory heap size using the jvm options -Xms 512m and -Xmx 1024m for min heap size and max heap size. Values can change according to the product.

If this dosent help then the jvm option -XX:+AggressiveHeap can be given to make the heap GC aggressively. this clears the heap quite frequently and increases the percentage of GC.

Changing the GC collector algorithms also help smtimes. though the default GC is recommended.

Aggresive heap and increasing java heap size helped me to overcome this problem.

Some sites which helped me in my research

http://java.sun.com/docs/hotspot/gc1.4.2/

http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp heap size options

http://tomcat.apache.org/tomcat-5.5-doc/printer/windows-service-howto.html   tomcat options

Written by sagarika

April 17, 2012 at 5:43 pm

Windows : Mangage services cmd line

leave a comment »

If you are used to windows then to check u r services the usual way is services.msc or go from the start ( a longer way). but trust me when you are doing a lot of administration stuff on services everytime opening the services refreshing and searching the service is quite elaborated work.

The best way is to use cmd lines.

To start and stop a service we have two options

using the net commands or the sc command

net command

C:\> net start servicename

C:\> net stop servicename

sc commands

to check the service status and its details

C:\> sc query servicename

to delete a service

C:\> sc delete servicename

to start a service

C:\> sc start servicename

to stop a service

C:\> sc stop servicename

Written by sagarika

March 28, 2012 at 9:51 am

‘Logon as service’ security policy permission to user

leave a comment »

when creating a new user either through cmd line /vb script/ windows it dosent by default have many local policy settings.
If creating a user to start a service the permission policy ” Logon as service ” is needed. This can be given through local policy settings.
But if this has to be given in script then one option is using the ntrights.exe utility which comes as a support to windows server.As this utility isnt there by default u cant ensure the same in the customer systems.

The following VB script can be used to give the Logon as service permissions


Dim infValues ,infFile ,oFSO ,Wsh_Shell ,sCommand

Set Wsh_Shell = WScript.CreateObject("WScript.Shell")

sCommand= "net user /add newuser newpswd /expires:never /fullname:newuser /passwordchg:no"
Wsh_Shell.Run ( sCommand, 0, True )

infFile= "C:\temp\vmtemplate.inf"


Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CreateTextFile(infFile)

Set f = oFSO.OpenTextFile(infFile, 2)
f.Writeline("[Unicode]")
f.Writeline("Unicode=yes")
f.Writeline("[Version]")
f.Writeline("signature=" & chr(34) & "$CHICAGO$" & chr(34))
f.Writeline("Revision=1")
f.Writeline("[Privilege Rights]")
f.Writeline("SeServiceLogonRight = newuser")

f.Close()

sCommand = "SECEDIT /configure /db secedit.sdb /cfg " & chr(34) & infFile & chr(34)

Wsh_Shell.Run(sCommand)

oFSO.DeleteFile(infFile)

The template.inf file is a template for adding the policies and SeServiceLogonRight is used for giving the logon right to a particular user. more users can be added with comma separation.
The same code can be used to give policy permissions to user only change need to be in the template.inf file

If you are not sure what to write in the template.inf file create a dummy file from windows and the same format can be replicated in the script.

Written by sagarika

March 20, 2012 at 11:43 am

Kick off Log4j – my e-book on log4j

leave a comment »

 

Ive written an ebook on log4j named kick off log4j. Its a simple ebook for developers who just want to start working on log4j. This book is based on the research ive done on  log4j and ive wrote down at every level what ive being doing to help other developers not to search for examples on different topics. I do recommend the actual log4j books to have more insight onto it. But if u dont have time to go through the whole book to understand the technology and have to start working on it by looking at some examples this is the right place.

 
Any modifications/additions please feel free to let me know .

View this document on Scribd

Written by sagarika

February 15, 2012 at 7:12 am

Flex legend not display issue

with 2 comments

In flex 4 versions there are sometimes issue with displaying legends for a graph. Even though the legend is pointing to the right dataprovider not all the legend values are displayed. After some mouse events the legend values start to appear and disapper without any reason.

Without legend values the chart look somewhat like this.

This sometimes happen because of the FTE(Flash Text engine). The default renderer for the LegendItem being UIFTEText gives this issue. Modify the css file to use UIText rather than UIFTETExt as the flash text engine is having some issues in the legend item

mx|LegendItem {

textFieldClass: ClassReference("mx.core.UITextField");

}

This resolves the legend value display issue but FTE has its own advantages of unicode support those might not be available. This is a flex bug and will be updated in next version this workaround can be used until then.

Written by sagarika

February 7, 2012 at 7:03 am

Posted in Flex

Tagged with , , , , , , ,

Log trace in Flex

leave a comment »

Flex debugger either with eclipse flex plugin or flash builder can be used to debug flex applications. If apart from debug variables u wanted to log some data that can be done using the trace() function.

To log from flex in to a external log file the following steps can be followed.

  • Create a mm.cfg file for flash debugger configuration. The default path where you can put it

In windows c:\users\username\

Linux /home/username

  • If mm.cfg not present create on and make sure these properties are there

    mm.cfg

    ErrorReportingEnable=1

    TraceOutputFileEnable=1

  • The log file will be generated in

    Windows : C:\Users\username\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt

    Linux: /home/username/.macromedia/Flash_Player/Logs/flashlog.txt

    For additional properties refer http://kb2.adobe.com/cps/403/kb403009.html

Written by sagarika

February 6, 2012 at 11:32 am

Posted in Flex

Tagged with , , , , , , ,

Follow

Get every new post delivered to your Inbox.