stephanrauh / AngularFaces

AngularFaces is a JSF library making it easy to integrate AngularJS code.
https://www.angularfaces.net
Apache License 2.0
90 stars 39 forks source link

Error using AngularFaces on Myfaces WAS Liberty #67

Closed deronrspencer closed 8 years ago

deronrspencer commented 8 years ago

I am getting the following error while trying to load an application with AngularFaces. App uses BootsFaces, PrimeFaces, MyFaces and AngularFaces. Everything worked fine prior to adding AngularFaces to the pom.xml and configuring the context-param in the web.xml as per instructions. Now I am getting...

java.lang.IllegalArgumentException: Couldn't create neither a Oracle Mojarra Tag attribute nor an Apache MyFaces TagAttribute
    at de.beyondjava.angularFaces.core.tagTransformer.TagAttributeUtilities.createTagAttribute(TagAttributeUtilities.java:40)
    at de.beyondjava.angularFaces.core.tagTransformer.AngularTagDecorator.extractAngularAttributes(AngularTagDecorator.java:331)
    at de.beyondjava.angularFaces.core.tagTransformer.AngularTagDecorator.createTags(AngularTagDecorator.java:210)
    at de.beyondjava.angularFaces.core.tagTransformer.AngularTagDecorator.decorate(AngularTagDecorator.java:204)
    at org.apache.myfaces.view.facelets.tag.CompositeTagDecorator.decorate(CompositeTagDecorator.java:55)
    at org.apache.myfaces.view.facelets.tag.BaseMultipleTagDecorator.decorate(BaseMultipleTagDecorator.java:46)
...
.
.
Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.view.facelets.tag.TagAttributeImpl
    at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:433)
    at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:267)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:411)
    at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:383)...
.
.

Any ideas/help would be greatly appreciated

tandraschko commented 8 years ago

@stephanrauh a hint from my side :)

Class#forName will probably not work correctly on some AS. You should use the thread context classloader, but even this might not work for WAS. See: https://github.com/primefaces/primefaces/issues/680

stephanrauh commented 8 years ago

@theglobalyst As a short-term workaround, I suggest not to use the AngularTagDecorator.

Maybe it's a bug that's easy to fix, like Thomas (@tandraschko) said. But I'm not sure when I find some time to spare to fix it.

stephanrauh commented 8 years ago

@theglobalyst I just uploaded AngularFaces 2.1.11 to MavenCentral. Maybe the bugfix suggested by Thomas helps. If not, I'll have to think of an alternative, so please report back whether AF 2.1.11 works for you or not.

Thanks in advance Stephan

deronrspencer commented 8 years ago

Nice. 2.1.11 works! Thanks

stephanrauh commented 8 years ago

Now, that's sort of a surprise! I'm glad I could help you! But of course, the honour goes to @tandraschko - Thomas, I'd never figured that out without your help!