[JBoss Seam] - how to use taskinstance??
by juangiovanolli
i'm trying to persist variables into the current taskInstance. for this i'm injecting the taskInstance object of jboss.seam.core. but it fails as you can see below:
|
| javax.faces.el.EvaluationException: /main.xhtml @13,49 value="#{taskManager.description}": Exception getting value of property description of base of type : com.santex.darwin.web.sample.TaskBean$$EnhancerByCGLIB$$c41132d8
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:135)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:53)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.faces.el.EvaluationException: Bean: com.santex.darwin.web.sample.TaskBean$$EnhancerByCGLIB$$c41132d8, property: description
| at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442)
| at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
| at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
| at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
| at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
| ... 36 more
| Caused by: java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
| ... 42 more
| Caused by: org.jboss.seam.RequiredException: In attribute requires value for component: taskManager.taskInstance
| at org.jboss.seam.Component.getInstanceToInject(Component.java:1823)
| at org.jboss.seam.Component.injectFields(Component.java:1312)
| at org.jboss.seam.Component.inject(Component.java:1082)
| at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:55)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:128)
| at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
| at com.santex.darwin.web.samp
|
and the class where i'm trying to inject it is this:
TaskBean.java
| package com.santex.darwin.web.sample;
|
| import javax.ejb.Remove;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.CreateProcess;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.EndTask;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.StartTask;
| import org.jboss.seam.core.TaskInstance;
|
| import com.santex.darwin.service.core.workflow.WorkflowManager;
|
| /**
| *
| * @author Juan Giovanolli
| * 29/11/2006
| */
| @Name("taskManager")
|
| public class TaskBean implements Task
| {
|
| private String description;
|
| @In(create = true)
| WorkflowManager workflowManagerImpl;
|
|
| @In(create=true)
| TaskInstance taskInstance;
|
|
| public WorkflowManager getWorkflowManagerImpl()
| {
| return workflowManagerImpl;
| }
|
| public void setWorkflowManagerImpl(WorkflowManager workflowManagerImpl)
| {
| this.workflowManagerImpl = workflowManagerImpl;
| }
|
| /**
| * @return the description
| */
| public String getDescription()
| {
| return description;
| }
|
| /**
| * @param description the description to set
| */
| public void setDescription(String pDescription)
| {
| this.description = pDescription;
| }
|
| @StartTask
| public String startTask() {
| try {
| taskInstance.getTaskInstance().setVariable("a1", a);
| }
| catch (Exception e) {
| e.printStackTrace();
| }
| return "";
| }
|
| @EndTask
| public String endTask() {
| try {
| taskInstance.getTaskInstance().setVariable("a2", a);
| }
| catch (Exception e) {
| e.printStackTrace();
| }
| return "";
| }
|
| @Remove @Destroy
| public void destroy() {
|
| }
|
| @CreateProcess(definition = "ProcessAbstract")
| public String startProcess()
| {
| return "";
| }
|
| }
|
|
Any ideas?? or still better: any examples?
Thks.!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991068#3991068
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991068
18 years, 1 month
[JBoss Seam] - Using textInput inside a dataTable inside a form?
by SmokingAPipe
Let's say that I want a user to be able to update an invoice with many line items on it. They should be able to make all their quantity updates and hit submit. The abreviated and somewhat simplified HTML might look like this:
| <form>
| <table>
| <tr>
| <th>Item:</th>
| <th>Quantitiy ordered</th>
| </tr>
|
| <tr>
| <td>Diet Coke</td>
| <td><input name="invoice[0]quantity" type="text" value="5"/></th>
| </tr>
|
| <tr>
| <td>Sprite</td>
| <td><input name="invoice[1]quantity" type="text" value="2"/></th>
| </tr>
| </table>
|
| <input type="submit" value="Update quantities"/>
| </form>
|
I like to use these contructions quite a lot. I have tried, without success, to make something like this work. The problem is that I'll have a table like this:
| <h:form>
| <t:dataTable id="invoiceTable"
| var="item"
| value="#{invoice.items}"
| >
|
| <t:column>
| <f:facet name="header">
| <h:outputText value="Item name"/>
| </f:facet>
| <h:outputText value="#{item.name}"/>
| </t:column>
|
| <t:column>
| <f:facet name="header">
| <h:outputText value="Quantity"/>
| </f:facet>
|
| <h:inputText value="#{item.quantity}" size="5"/>
|
| </t:column>
| </t:dataTable>
|
| <h:commandButton value="Update invoice" action="#{invoiceManager.update}"/>
|
| </h:form>
|
which of course, does not work, because the inputText value="#{item.quantity}" is not actually a value binding because the "item" variable only exists within the table iteration (is this correct?) Is there a way to get this type of thing to work? I'm totally stumped.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991067#3991067
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991067
18 years, 1 month
[Installation, Configuration & Deployment] - Invalid use of destroyed classloader
by fmaredia
Using Apache AXIS, we get the following error after our application has been hot redeployed . There is no problem on the front-end, even as far as functionality, however an error is generated in the log. It seems that the class gets destroyed and does not seem to be rebuilt properly. I am not sure what I really need to do to resolve the problem. If I restart the JBoss server then everything works fine (once again initially until I redeploy then the error occurs again), however I do not want to restart every time I need to redeploy my application.
The following is the error, once again it only appears after we redeploy the application:
10:59:54,415 ERROR [STDERR] java.io.IOException: Invalid use of destroyed classloader, UCL destroyed at:
10:59:54,415 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.findResources(RepositoryClassLoader.java:585)
10:59:54,415 ERROR [STDERR] at java.lang.ClassLoader.getResources(ClassLoader.java:1015)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.jdk.JDK12Hooks.getResources(JDK12Hooks.java:150)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResources(DiscoverResources.java:153)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResource(DiscoverResources.java:129)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.resource.DiscoverResources$1.hasNext(DiscoverResources.java:116)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassNames(DiscoverNamesInFile.java:186)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassName(DiscoverNamesInFile.java:170)
10:59:54,415 ERROR [STDERR] at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.hasNext(DiscoverNamesInFile.java:157)
10:59:54,431 ERROR [STDERR] at org.apache.commons.discovery.resource.names.NameDiscoverers$1.getNextIterator(NameDiscoverers.java:143)
10:59:54,431 ERROR [STDERR] at org.apache.commons.discovery.resource.names.NameDiscoverers$1.hasNext(NameDiscoverers.java:126)
10:59:54,431 ERROR [STDERR] at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:159)
10:59:54,431 ERROR [STDERR] at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:147)
10:59:54,431 ERROR [STDERR] at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:120)
10:59:54,431 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
10:59:54,431 ERROR [STDERR] at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
10:59:54,431 ERROR [STDERR] at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
10:59:54,431 ERROR [STDERR] at org.apache.axis.client.Service.getEngineConfiguration(Service.java:812)
10:59:54,431 ERROR [STDERR] at org.apache.axis.client.Service.getAxisClient(Service.java:103)
10:59:54,431 ERROR [STDERR] at org.apache.axis.client.Service.(Service.java:112)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991066#3991066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991066
18 years, 1 month
[EJB 3.0] - Problem with named query...
by EricChile
I am getting the following error when deploying because of a named query. It seems that hibernate is not following the mapping correctly?
org.hibernate.QueryException: could not resolve property: serviceCode of: org.usiis.model.ProviderUsers [select o from org.usiis.model.Users o Where o.providerUsersList.providerId = :providerId AND o.providerUsersList.providerUserServicesList.serviceCode = :serviceCode AND (o.providerUsersList.providerUserServicesList.
| dateEnd <= :endDate OR o.providerUsersList.providerUserServicesList.dateStarted is null)order by o.username ]
|
BEANs
Users
|
| @Entity
| @NamedQueries({
|
|
| @NamedQuery(name = "Users.findAllInactiveByProviderIdServiceCodeDate",
| query = "select o from Users o Where o.providerUsersList.providerId = :providerId " +
| "AND o.providerUsersList.providerUserServicesList.serviceCode = :serviceCode " +
| "AND (o.providerUsersList.providerUserServicesList.dateEnd <= :endDate " +
| "OR o.providerUsersList.providerUserServicesList.dateStarted is null)" +
| "order by o.username ")
|
|
| @Id
| @Column(name="USER_ID", nullable = false)
| private Long userId;
| @OneToMany(mappedBy = "users")
| private List<ProviderUsers> providerUsersList;
|
|
|
ProviderUsers
| @Id
| @Column(name="PROVIDER_USER_ID", nullable = false)
| private Long providerUserId;
| @Column(name="PROVIDER_ID")
| private String providerId;
| @OneToMany(mappedBy = "providerUsers")
| private List<ProviderUserServices> providerUserServicesList;
|
|
ProviderUserServices
| @Column(name="DATE_END")
| private Timestamp dateEnd;
| @Column(name="DATE_REQUESTED", nullable = false)
| private Timestamp dateRequested;
| @Column(name="DATE_STARTED")
| private Timestamp dateStarted;
| @Column(name="SERVICE_CODE", nullable = false)
| private Long serviceCode;
| @Id
| @Column(name="USER_SERVICES_ID", nullable = false)
| private Long userServicesId;
|
Why does hibernate want to associate serviceCode with ProviderUsers when it is in ProviderUserServices in the query? Is this a bug with hibernate?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991065#3991065
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991065
18 years, 1 month
[JBoss Seam] - Re: Security
by SmokingAPipe
I'm looking forward to it. I spent several days looking into the Java Security APIs and I got the big Sun Java Security book and read it. I want a simple way to let users log in and view web pages! How hard could that be? But after carefully reading Sun's Java Security book, I learned that I could easily build plugable security architectures and whatever but there was no reasonable way to, say, password protect a database. I'm looking forward to being able to do declarative security: "These web pages can only be accessed by users in role ___. These class methods can only be accessed by users in role ___. These objects can only be accessed by users in role ___." Combine that with annotations on classes like, "this class is a user with role ___", and then a way to define a Authentication class that lets me say "if(password.equalsIgnoreCase(user.password)). HOW HARD COULD THAT BE? And yet there doesn't seem to be any way to do that at all with Sun's security architecture. Anyway if Seam can make that happen that will be great.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991061#3991061
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991061
18 years, 1 month