[JBoss Seam] - IllegalAccessError: Could not instantiate Seam component
by enrokuta
I have a stateless session bean called UploadService that handles file uploads. I was able to use it with no problems for days till I added few setters/getters and a method to scale the uploaded image.
After login and once a reference of uploadService is encountered, an instantiation exception is thrown that is caused by " IllegalAccessError: class XYZ cannot access its superinterface com.truerunes.core.Upload"
| 23:09:17,761 ERROR [STDERR] Oct 12, 2007 11:09:17 PM com.sun.facelets.FaceletViewHandler handleRenderException
| SEVERE: Error Rendering View[/artwork.xhtml]
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: uploadService
| at org.jboss.seam.Component.newInstance(Component.java:1971)
| at org.jboss.seam.Component.getInstance(Component.java:1874)
| at org.jboss.seam.Component.getInstance(Component.java:1841)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
| at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
| at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
| at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
| at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
| at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
| at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
| at org.jboss.seam.ui.renderkit.ValidateAllRendererBase.doEncodeChildren(ValidateAllRendererBase.java:33)
| at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
| at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.lang.RuntimeException: by java.lang.IllegalAccessError: class org.javassist.tmp.java.lang.Object_$$_javassist_7 cannot access its superinterface com.truerunes.core.Upload
| at org.jboss.seam.util.ProxyFactory.createClass(ProxyFactory.java:190)
| at org.jboss.seam.Component.createProxyFactory(Component.java:2261)
| at org.jboss.seam.Component.getProxyFactory(Component.java:1376)
| at org.jboss.seam.Component.wrap(Component.java:1367)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1289)
| at org.jboss.seam.Component.instantiate(Component.java:1274)
| at org.jboss.seam.Component.newInstance(Component.java:1967)
| ... 72 more
| Caused by: javassist.CannotCompileException: by java.lang.IllegalAccessError: class org.javassist.tmp.java.lang.Object_$$_javassist_7 cannot access its superinterface com.truerunes.core.Upload
| at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:165)
| at org.jboss.seam.util.ProxyFactory.createClass(ProxyFactory.java:186)
| ... 78 more
| Caused by: java.lang.IllegalAccessError: class org.javassist.tmp.java.lang.Object_$$_javassist_7 cannot access its superinterface com.truerunes.core.Upload
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
| at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:177)
| at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:159)
|
| @Local
| interface Upload {
| byte[] getData();
| void setData(byte[] data);
| String getContentType();
| void setContentType(String contentType);
| String getFileName();
| void setFileName(String fileName);
| String getTitle();
| void setTitle(String title);
| int getSize();
| void setSize(int size);
| void upload();
| }
|
I did not include the scale code since it is a bit verbose and might be irrelevant to the problem. However, you can find the imports used:
| import java.awt.Graphics2D;
| import java.awt.RenderingHints;
| import java.awt.Transparency;
| import java.awt.image.BufferedImage;
| import java.io.ByteArrayInputStream;
| import java.io.ByteArrayOutputStream;
| import java.io.IOException;
| import java.io.InputStream;
| import java.io.OutputStream;
| import java.util.Date;
|
| import javax.ejb.Stateless;
| import javax.imageio.ImageIO;
| import javax.persistence.EntityManager;
|
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.security.Restrict;
| import org.jboss.seam.log.Log;
|
| @Stateless
| @Name("uploadService")
| public class UploadService implements Upload {
|
| @Logger Log log;
|
| @In(create = true, value = "entityManager")
| private EntityManager em;
|
| private byte[] data;
| private String contentType;
| private String fileName;
| private String title;
| private int size;
|
| // setters/getters omitted.
|
| @Restrict("#{s:hasRole('gsadmin')}")
| public void upload() {
| }
|
| private byte[] scale(){
| }
| }
|
here is the page that references the uploadService component:
| <h:form id="registration-form" enctype="multipart/form-data">
| <span class="error"><h:messages globalOnly="true"/></span>
| <s:validateAll>
| <fieldset>
| <legend>Enter file to upload</legend>
| <div>
| <h:outputLabel for="title" value="Title"/>
| <h:inputText styleClass="input-field" id="title" required="true"
| value="#{uploadService.title}" size="40" maxlength="40"/>
| <h:message styleClass="error" for="title"/>
| </div>
| <div>
| <h:outputLabel for="artwork" value="Artwork"/>
| <s:fileUpload id="artwork" styleClass="input-field"
| data="#{uploadService.data}" accept="image/*"
| contentType="#{uploadService.contentType}"
| fileName="#{uploadService.fileName}" fileSize="#{uploadService.size}"
| size="40" maxlength="40" required="true"/>
| <h:message styleClass="error" for="artwork"/>
| </div>
| </fieldset>
|
| <div class="submit-buttons">
| <h:commandButton value="Upload"
| action="#{uploadService.upload}" id="registerButton"/>
| </div>
| </s:validateAll>
| </h:form>
|
I tried updating from JDK 5 to JDK 6, rebuilding and removing the old deployed archive but the problem is still there.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094778#4094778
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094778
18Â years, 9Â months
[JBoss Tools (users)] - Re: WTP2.0.1, JBossAS-Tools-1.0.0.beta4 not publishing corre
by max.andersenï¼ jboss.com
"dlmiles" wrote :
| "max.anderson(a)jboss.com" wrote : I never seen anything in that tmp file location you mention - it just contains a profile.dat file which I think just represents the last list of resources that have been copied ?
|
| Can you be more specific? Are you windows or linux ?
|
both.
anonymous wrote :
| Have you ever create a Tomcat runtime and WAR/DWP deployed to it ?
|
sure - but now we are talking about fixing our jboss adapter deployment....
anonymous wrote :
| Have you even created JBoss runtime using WTP driver and deployed to it ? If no and no then I wouldn't expect to see much in the directory if you've never had a publish failure.
|
I stepped through the code of jstpublisher andi don't see any temp file copying being performed when we use our adapter...I do realize that tomcat and jboss adapter does this of different reasons (tomcat - has it as a "deploy" location and jboss wtp as a tmp storage before zipping it up)
anonymous wrote :
| What is the specific path on your computer you are looking at ?
|
the one you gave me. .metadata/org.eclipse...etc.
anonymous wrote :
| Can you confirm the absolute path to your JBoss runtime, I have not verified if the problem I see is re-creatable on windows by having JBoss runtime on a different drive letter. I'm not sure if windows has rename magic (which turns out to be a file copy) if you rename a file across drive letters.
I'm not saying we don't have issues across disk boundaries; i'm just saying i'm not seeing any temporary files being created...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094777#4094777
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094777
18Â years, 9Â months