| Summary: | Scripting framework - is there a way to return the script (file) name to the user in the event of an error? | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise SOA Platform 4 | Reporter: | Len DiMaggio <ldimaggi> |
| Component: | JBossESB | Assignee: | Len DiMaggio <ldimaggi> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 4.3 IR4 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.3 IR5 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://jira.jboss.org/jira/browse/SOA-765 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: |
SOA-P IR4
|
|
| Last Closed: | 2008-10-06 13:34:57 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Link: Added: This issue is a dependency of JBESB-2002 The update is in ScriptingAction.java:
final String error = "Exception caught while processing script: '" + source + "'" ;
if (logger.isDebugEnabled())
{
logger.debug(error, bsfe) ;
}
throw new ActionProcessingException(error, bsfe);
But the exception is not raised:
15:14:05,297 INFO [ScriptingAction] add_beanshell_link: (chain)~(beanshell)
15:14:07,109 ERROR [STDERR] Traceback (innermost last):
(no code object) at line 0
15:14:07,110 ERROR [STDERR] File "<string>", line 2
15:14:07,110 ERROR [STDERR] logger.1#@%^=//@\\q qqq let's cause a syntax error
15:14:07,110 ERROR [STDERR] ^
15:14:07,115 ERROR [STDERR] SyntaxError: invalid syntax
15:14:07,211 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:1099/queue/quickstart_scripting_chain_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 938c5dc0-a79c-4359-aa37-114c3f89a279 RelatesTo: jms:correlationID#938c5dc0-a79c-4359-aa37-114c3f89a279
The last line would suggest that the exception is raised. Why do you think it hasn't been? Because I forgot to check in the log for the DEBUG level message ;-) the script name is there...
2008-10-06 09:33:06,795 ERROR [STDERR] Traceback (innermost last):
(no code object) at line 0
2008-10-06 09:33:06,795 ERROR [STDERR] File "<string>", line 1
2008-10-06 09:33:06,795 ERROR [STDERR] logger.1#@%^=//@\\q qqq let's cause a syntax error
2008-10-06 09:33:06,795 ERROR [STDERR] ^
2008-10-06 09:33:06,800 ERROR [STDERR] SyntaxError: invalid syntax
2008-10-06 09:33:06,801 DEBUG [org.jboss.soa.esb.actions.scripting.ScriptingAction] Exception caught while processing script: '/scripts/link.py'
org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
(no code object) at line 0
File "<string>", line 1
logger.1#@%^=//@\\q qqq let's cause a syntax error
^
SyntaxError: invalid syntax
Verified in IR5 |
Date of First Response: 2008-10-06 04:09:15 project_key: SOA In looking at the scripting_chain quickstart, I wanted to see how errors in the scripts would be handled and reported - via the server.log - to the user. So, I introduced this syntax error into the scripts/link.py script: =================== cat scripts/link.py logger.1#@%^=//@\\q qqq let's cause a syntax error # Jython script: link.py chain = payloadProxy.getPayload(message) + "~(jython)" logger.info(config.getAttribute("action") + ": " + chain) payloadProxy.setPayload(message, chain) =================== Running this from the shell returns: /opt/jython2.2.1/jython scripts/link.py Traceback (innermost last): (no code object) at line 0 File "scripts/link.py", line 1 logger.1#@%^=//@\\q qqq let's cause a syntax error ^ SyntaxError: invalid syntax The ESB server.log returns: 13:34:48,314 INFO [ScriptingAction] add_beanshell_link: (chain)~(beanshell) 13:34:48,316 ERROR [STDERR] Traceback (innermost last): (no code object) at line 0 13:34:48,316 ERROR [STDERR] File "<string>", line 1 13:34:48,316 ERROR [STDERR] logger.1#@%^=//@\\q qqq let's cause a syntax error 13:34:48,316 ERROR [STDERR] ^ 13:34:48,321 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:1099/queue/quickstart_scripting_chain_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 70cb023e-3489-4a97-bde6-dabe7d894dcf RelatesTo: jms:correlationID#70cb023e-3489-4a97-bde6-dabe7d894dcf Is there anyway to get the script name and not: File "<string>" into the log message?