Remove struts mapping messages from console

Posted on Updated on

You might be wandering that you have configured struts correctly but you still see some debug messages on the console related to struts config while starting any application server. Dont worry, struts is configured correctly. It is some other configurations that is displaying this message.  Read below to solve your issue.

It is due to some excessive code written in log4j configuration of your project. When the server runs, the debug message shown is something like below:

 

Convert string ‘/’ to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]
Converting ‘String’ value ‘/’ to type ‘String’
setSimpleProperty: Invoking method public void org.apache.struts.config.ActionConfig.setInput(java.lang.String) with value / (class java.lang.String)
setProperty(ActionConfig[cancellable=false,path=null,validate=true,input=/,scope=session, parameter, methodName)
Target bean = ActionConfig[cancellable=false,path=null,validate=true,input=/,scope=session
Target name = parameter
Convert string ‘methodName’ to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]


Converting ‘String’ value ‘methodName’ to type ‘String’
setSimpleProperty: Invoking method public void org.apache.struts.config.ActionConfig.setParameter(java.lang.String) with value methodName (class java.lang.String)
setProperty(ActionConfig[cancellable=false,path=null,validate=true,input=/,parameter=methodName,scope=session, scope, request)
Target bean = ActionConfig[cancellable=false,path=null,validate=true,input=/,parameter=methodName,scope=session
Target name = scope
Convert string ‘request’ to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]
Converting ‘String’ value ‘request’ to type ‘String’
setSimpleProperty: Invoking method public void org.apache.struts.config.ActionConfig.setScope(java.lang.String) with value request (class java.lang.String)
setProperty(ActionConfig[cancellable=false,path=null,validate=true,input=/,parameter=methodName,scope=request, name, )
Target bean = ActionConfig[cancellable=false,path=null,validate=true,input=/,parameter=methodName,scope=request
Target name = name
Convert string ” to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]
Converting ‘String’ value ” to type ‘String’
setSimpleProperty: Invoking method public void org.apache.struts.config.ActionConfig.setName(java.lang.String) with value (class java.lang.String)
setProperty(ActionConfig[cancellable=false,path=null,validate=true,input=/,name=,parameter=methodName,scope=request, path, /FetchMTRApprovedInfoAction)
Target bean = ActionConfig[cancellable=false,path=null,validate=true,input=/,name=,parameter=methodName,scope=request
Target name = path
Convert string ‘/FetchMTRApprovedInfoAction’ to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]
Converting ‘String’ value ‘/FetchMTRApprovedInfoAction’ to type ‘String’
setSimpleProperty: Invoking method public void org.apache.struts.config.ActionConfig.setPath(java.lang.String) with value /FetchMTRApprovedInfoAction (class java.lang.String)
Target bean = ActionConfig[cancellable=false,path=/FetchMTRApprovedInfoAction,validate=true,input=/,name=,parameter=methodName,scope=request
Target name = type
Fire begin() for SetNextRule[methodName=addActionConfig, paramType=org.apache.struts.config.ActionConfig]
ignorableWhitespace(
)
startElement(,forward,forward)
Pushing body text ”
New match=’struts-config/action-mappings/action/forward’
Fire begin() for FactoryCreateRule[className=null, attributeName=null, creationFactory=org.apache.struts.config.ActionForwardFactory@ba5c7a]
[FactoryCreateRule]{struts-config/action-mappings/action/forward} New org.apache.struts.action.ActionForward
Fire begin() for SetPropertiesRule[]
[SetPropertiesRule]{struts-config/action-mappings/action/forward} Setting property ‘name’ to ‘success’
[SetPropertiesRule]{struts-config/action-mappings/action/forward} Setting property ‘path’ to ‘/Pages/DoT/MicroTradeRegistration/ApprovedPage.jsp’
[SetPropertiesRule]{struts-config/action-mappings/action/forward} Set org.apache.struts.action.ActionForward properties
BeanUtils.populate(ForwardConfig[name=null,path=null,redirect=false,module=null,extends=null,catalog=null,command=null], {name=success, path=/Pages/DoT/MicroTradeRegistration/ApprovedPage.jsp})
setProperty(ForwardConfig[name=null,path=null,redirect=false,module=null,extends=null,catalog=null,command=null], name, success)
Target bean = ForwardConfig[name=null,path=null,redirect=false,module=null,extends=null,catalog=null,command=null]
Target name = name
Convert string ‘success’ to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]
Converting ‘String’ value ‘success’ to type ‘String’
setSimpleProperty: Invoking method public void org.apache.struts.config.ForwardConfig.setName(java.lang.String) with value success (class java.lang.String)
setProperty(ForwardConfig[name=success,path=null,redirect=false,module=null,extends=null,catalog=null,command=null], path, /Pages/DoT/MicroTradeRegistration/ApprovedPage.jsp)
Target bean = ForwardConfig[name=success,path=null,redirect=false,module=null,extends=null,catalog=null,command=null]
Target name = path
Convert string ‘/Pages/DoT/MicroTradeRegistration/ApprovedPage.jsp’ to class ‘java.lang.String’
Using converter ConverterFacade[StringConverter[UseDefault=true]]
Converting ‘String’ value ‘/Pages/DoT/MicroTradeRegistration/ApprovedPage.jsp’ to type ‘String’

Fire end() for FactoryCreateRule[className=null, attributeName=null, creationFactory=org.apache.struts.config.ActionMappingFactory@82d37]
[FactoryCreateRule]{struts-config/action-mappings/action} Pop org.apache.struts.action.ActionMapping
ignorableWhitespace(
)
ignorableWhitespace(

)
ignorableWhitespace(
)
endElement(,action-mappings,action-mappings)
match=’struts-config/action-mappings’
bodyText=”
Fire body() for org.apache.struts.config.SetActionMappingClassRule@147c1db
Popping body text ”
Fire end() for org.apache.struts.config.SetActionMappingClassRule@147c1db
ignorableWhitespace(
)
ignorableWhitespace(
)
ignorableWhitespace(
)
startElement(,message-resources,message-resources)
Pushing body text ”
New match=’struts-config/message-resources’
Fire begin() for ObjectCreateRule[className=org.apache.struts.config.MessageResourcesConfig, attributeName=className]
[ObjectCreateRule]{struts-config/message-resources}New org.apache.struts.config.MessageResourcesConfig
Fire begin() for SetPropertiesRule[]
Fire begin() for SetNextRule[methodName=addMessageResourcesConfig, paramType=org.apache.struts.config.MessageResourcesConfig]
endElement(,message-resources,message-resources)
match=’struts-config/message-resources’
bodyText=”
Fire body() for ObjectCreateRule[className=org.apache.struts.config.MessageResourcesConfig, attributeName=className]
Fire body() for SetPropertiesRule[]
Fire body() for SetNextRule[methodName=addMessageResourcesConfig, paramType=org.apache.struts.config.MessageResourcesConfig]
Popping body text ”
Fire end() for SetNextRule[methodName=addMessageResourcesConfig, paramType=org.apache.struts.config.MessageResourcesConfig]
[SetNextRule]{struts-config/message-resources} Call org.apache.struts.config.impl.ModuleConfigImpl.addMessageResourcesConfig(org.apache.struts.config.MessageResourcesConfig)
isPublic:true
Fire end() for SetPropertiesRule[]
Fire end() for ObjectCreateRule[className=org.apache.struts.config.MessageResourcesConfig, attributeName=className]
[ObjectCreateRule]{struts-config/message-resources} Pop org.apache.struts.config.MessageResourcesConfig
ignorableWhitespace(

)
endElement(,struts-config,struts-config)
match=’struts-config’
bodyText=”
No rules found matching ‘struts-config’.
Popping body text ”
endDocument()
Operating in Default mode [null]
Initializing module path ” plug ins
Initializing module path ” form beans
Processing extensions for ‘mtrCIDInfo’
Processing extensions for ‘detailForm’
Initializing module path ” forwards
Initializing module path ” forwards
Initializing module path ” action configs
Processing extensions for ‘/commonPageAction’
Processing extensions for ‘/submitcid’
Processing extensions for ‘failure’
Processing extensions for ‘getInfo’
Processing extensions for ‘success’
Processing extensions for ‘/submitDoTDetails’
Processing extensions for ‘failure’
Processing extensions for ‘success’
Processing extensions for ‘/rtioDecission’
Processing extensions for ‘failure’
Processing extensions for ‘success’
Processing extensions for ‘redirect’
Processing extensions for ‘success’
Processing extensions for ‘failure’
Processing extensions for ‘success’
Processing extensions for ‘success’

To remove this, check your log4j configurations. Check for the following lines:

log4j.rootCategory=DEBUG, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout

Either remove or comment the last two lines and remove CONSOLE from the first line. Restart the server and the message is gone.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s