[jira] [Commented] (TOMEE-1021) Allow read JSF 2.2 faces-config.xml files

2016-05-30 Thread Petras (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15306430#comment-15306430
 ] 

Petras commented on TOMEE-1021:
---

This issue is marked as resolved, though I still get exception using TomEE 
7.0.0 if I try to used {{redirect-param}} element insider {{redirect}} as shown 
in my previous post:
{code}
Caused by: org.apache.tomee.catalina.TomEERuntimeException: 
org.apache.openejb.OpenEJBException: Cannot unmarshall the faces configuration 
file: file:/C:/.../WEB-INF/navigation-rules.xml: Unexpected element 
{http://xmlns.jcp.org/xml/ns/javaee}redirect-param, expected 
[{http://java.sun.com/xml/ns/javaee}view-param]
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2213)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1133)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1094)
at 
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 56 more
{code}

> Allow read JSF 2.2 faces-config.xml files
> -
>
> Key: TOMEE-1021
> URL: https://issues.apache.org/jira/browse/TOMEE-1021
> Project: TomEE
>  Issue Type: Improvement
>Reporter: Leonardo Uribe
> Fix For: 1.7.0
>
>
> Hi
> I'm working on MyFaces 2.2.x, and on the way I have found that Tomee doesn't 
> allow faces-config.xml files in JSF 2.2 format. Since the spec was out some 
> months ago, it would be great if you guys can allow this so I can test 
> MyFaces 2.2.x + Tomee just changing the jars. 
> Here is the exception I have:
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
>   at 
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
>   at 
> org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   at java.lang.Thread.run(Thread.java:724)
> Caused by: org.apache.tomee.catalina.TomEERuntimeException: 
> org.apache.openejb.OpenEJBException: Cannot unmarshall the faces 
> configuration file: Unexpected element 
> {http://xmlns.jcp.org/xml/ns/javaee}flow-definition, expected 
> [{http://java.sun.com/xml/ns/javaee}application, 
> {http://java.sun.com/xml/ns/javaee}ordering, 
> {http://java.sun.com/xml/ns/javaee}absolute-ordering, 
> {http://java.sun.com/xml/ns/javaee}factory, 
> {http://java.sun.com/xml/ns/javaee}component, 
> {http://java.sun.com/xml/ns/javaee}converter, 
> {http://java.sun.com/xml/ns/javaee}managed-bean, 
> {http://java.sun.com/xml/ns/javaee}name, 
> {http://java.sun.com/xml/ns/javaee}navigation-rule, 
> {http://java.sun.com/xml/ns/javaee}referenced-bean, 
> {http://java.sun.com/xml/ns/javaee}render-kit, 
> {http://java.sun.com/xml/ns/javaee}lifecycle, 
> {http://java.sun.com/xml/ns/javaee}validator, 
> {http://java.sun.com/xml/ns/javaee}behavior, 
> {http://java.sun.com/xml/ns/javaee}faces-config-extension]
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:1953)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1025)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:985)
>   at 
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:127)
>   at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>   at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>   at 
> 

[jira] [Created] (OPENEJB-2111) Unchecked application exceptions, thrown in asynchronous business methods, are always wrapped in EJBException

2015-03-16 Thread Petras (JIRA)
Petras created OPENEJB-2111:
---

 Summary: Unchecked application exceptions, thrown in asynchronous 
business methods, are always wrapped in EJBException
 Key: OPENEJB-2111
 URL: https://issues.apache.org/jira/browse/OPENEJB-2111
 Project: OpenEJB
  Issue Type: Bug
  Components: ejb31, tomee
Affects Versions: 4.7.1
Reporter: Petras


Example of my business method:
{code}
@Asynchronous
public FutureAttachmentWBean convertToPDF(File file, String contentType)
throws FileConverterException, OperationCancelledException {
final ConversionResultWBean wsResult = invokeFileConverterWS(file, 
contentType);
return new AsyncResult(wsResult.getResultFile());
}
{code}

FileConverterException is checked exception while OperationCancelledException 
class is unchecked and declared as ApplicationException:
{code}
@ApplicationException
public class OperationCancelledException extends RuntimeException {

   //...
}
{code}


The reason is that 
{{org.apache.openejb.async.AsynchronousPool.FutureAdapter#handleException}} 
method does not check whether exception is an unchecked ApplicationException 
and always wrapps it into EJBException. Only checked exceptions are returned 
directly:
{code}
private void handleException(Throwable e) throws ExecutionException {

//unwarp the exception to find the root cause
while (e.getCause() != null) {
e = e.getCause();
}

/*
 * StatefulContainer.obtainInstance(Object, ThreadContext, Method)
 * will return NoSuchObjectException instead of NoSuchEJBException  
   *
 * when it can't obtain an instance.   Actually, the async client
 * is expecting a NoSuchEJBException.  Wrap it here as a workaround.
 */
if (e instanceof NoSuchObjectException) {
e = new NoSuchEJBException(e.getMessage(), (Exception) e);
}

final boolean isExceptionUnchecked = e instanceof Error || e instanceof 
RuntimeException;

// throw checked excpetion and EJBException directly.
if (!isExceptionUnchecked || e instanceof EJBException) {
throw new ExecutionException(e);
}

// wrap unchecked exception with EJBException before throwing.
throw e instanceof Exception ? new ExecutionException(new 
EJBException((Exception) e))
: new ExecutionException(new EJBException(new Exception(e)));

}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TOMEE-1021) Allow read JSF 2.2 faces-config.xml files

2015-02-26 Thread Petras (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14338348#comment-14338348
 ] 

Petras commented on TOMEE-1021:
---

It seems still some issues left. I use TomEE v1.71 with MyFaces v2.2.7
For this navigation case:
{code:xml}
navigation-case
from-outcomesomeFlow/from-outcome
to-view-id/someFlow/someFlow.xhtml/to-view-id
redirect /
to-flow-document-id /
/navigation-case
{code}
Get:
{code}
Caused by: javax.xml.bind.UnmarshalException: Unexpected element 
{http://xmlns.jcp.org/xml/ns/javaee}to-flow-document-id, expected 
[{http://java.sun.com/xml/ns/javaee}description, 
{http://java.sun.com/xml/ns/javaee}display-name, 
{http://java.sun.com/xml/ns/javaee}icon, 
{http://java.sun.com/xml/ns/javaee}from-action, 
{http://java.sun.com/xml/ns/javaee}from-outcome, 
{http://java.sun.com/xml/ns/javaee}if, 
{http://java.sun.com/xml/ns/javaee}to-view-id, 
{http://java.sun.com/xml/ns/javaee}redirect]
at 
org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:390)
at 
org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:379)
at 
org.metatype.sxc.jaxb.RuntimeContext.unexpectedElement(RuntimeContext.java:225)
at 
org.apache.openejb.jee.FacesNavigationCase$JAXB._read(FacesNavigationCase$JAXB.java:181)
at 
org.apache.openejb.jee.FacesNavigationCase$JAXB.readFacesNavigationCase(FacesNavigationCase$JAXB.java:53)
at 
org.apache.openejb.jee.FacesNavigationRule$JAXB._read(FacesNavigationRule$JAXB.java:151)
at 
org.apache.openejb.jee.FacesNavigationRule$JAXB.readFacesNavigationRule(FacesNavigationRule$JAXB.java:54)
at 
org.apache.openejb.jee.FacesConfig$JAXB._read(FacesConfig$JAXB.java:257)
at 
org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:399)
at 
org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:61)
at org.apache.openejb.sxc.Sxc.unmarshall(Sxc.java:167)
at org.apache.openejb.sxc.Sxc.unmarhsal(Sxc.java:158)
at org.apache.openejb.sxc.Sxc.unmarshalJavaee(Sxc.java:143)
at 
org.apache.openejb.sxc.FacesConfigXml.unmarshal(FacesConfigXml.java:34)
at 
org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:827)
... 66 more
{code}

For navigation case
{code:xml}
navigation-case
from-outcomemyLetters/from-outcome
to-view-id/portal/letter/letterList.xhtml/to-view-id
redirect
redirect-param
nametype/name
valueLETTER/value
/redirect-param
/redirect
/navigation-case
{code}
get
{code}
Caused by: javax.xml.bind.UnmarshalException: Unexpected element 
{http://xmlns.jcp.org/xml/ns/javaee}redirect-param, expected 
[{http://java.sun.com/xml/ns/javaee}view-param]
at 
org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:390)
at 
org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:379)
at 
org.metatype.sxc.jaxb.RuntimeContext.unexpectedElement(RuntimeContext.java:225)
at 
org.apache.openejb.jee.FacesRedirect$JAXB._read(FacesRedirect$JAXB.java:117)
at 
org.apache.openejb.jee.FacesRedirect$JAXB.readFacesRedirect(FacesRedirect$JAXB.java:48)
at 
org.apache.openejb.jee.FacesNavigationCase$JAXB._read(FacesNavigationCase$JAXB.java:178)
at 
org.apache.openejb.jee.FacesNavigationCase$JAXB.readFacesNavigationCase(FacesNavigationCase$JAXB.java:53)
at 
org.apache.openejb.jee.FacesNavigationRule$JAXB._read(FacesNavigationRule$JAXB.java:151)
at 
org.apache.openejb.jee.FacesNavigationRule$JAXB.readFacesNavigationRule(FacesNavigationRule$JAXB.java:54)
at 
org.apache.openejb.jee.FacesConfig$JAXB._read(FacesConfig$JAXB.java:257)
at 
org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:399)
at 
org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:61)
at org.apache.openejb.sxc.Sxc.unmarshall(Sxc.java:167)
at org.apache.openejb.sxc.Sxc.unmarhsal(Sxc.java:158)
at org.apache.openejb.sxc.Sxc.unmarshalJavaee(Sxc.java:143)
at 
org.apache.openejb.sxc.FacesConfigXml.unmarshal(FacesConfigXml.java:34)
at 
org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:827)
... 66 more
{code}

 Allow read JSF 2.2 faces-config.xml files
 -

 Key: TOMEE-1021
 URL: https://issues.apache.org/jira/browse/TOMEE-1021
 Project: TomEE
  Issue Type: Improvement
Reporter: Leonardo Uribe
 Fix For: 1.7.0


 Hi
 I'm working on MyFaces 2.2.x, and on the way I have found that Tomee doesn't 
 allow faces-config.xml files in