[SOLVED] EJB i bibliteka XStream

0

Mam taki kod EJB:

 
package org.superbiz.jsf;
import com.thoughtworks.xstream.*;
import com.thoughtworks.xstream.io.xml.DomDriver;

import javax.ejb.Stateless;

@SuppressWarnings("unused")
class Animals {

    public Animals(String name, int age)
    {
            this.name = name;
            this.age = age;
    }

    private String name;
    private int age;

}

@Stateless
public class CalculatorImpl implements Calculator {

    public double add(double x, double y) {
        return x + y;
    }
    
    public String myrun() {
    	Animals animal = new Animals("pupu",27);

        XStream xstream = new XStream();
        String xml = xstream.toXML(animal);
        return xml;

    }

}

W momencie wywołania następuje potok wyjątków:

javax.servlet.ServletException: viewId:/calculator.jsf - View /calculator.jsf could not be restored.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
 

Mam dodane przez eclipse (Build Path) wymagane biblioteki :xstream-[version].jar, xpp3-[version].jar xmlpull-[version].jar.
Kod w wersji SE działa bez zarzutów.

1

To co dałeś wskazuje na problem z JSF

0

javax.servlet.ServletException: viewId:/calculator.jsf - View /calculator.jsf could not be restored.

0

Jak się przerobi to na :

 package org.superbiz.jsf;
import com.thoughtworks.xstream.*;
import com.thoughtworks.xstream.io.xml.DomDriver;
 
import javax.ejb.Stateless;
 
@SuppressWarnings("unused")
class Animals {
 
    public Animals(String name, int age)
    {
            this.name = name;
            this.age = age;
    }
 
    private String name;
    private int age;
 
}
 
@Stateless
public class CalculatorImpl implements Calculator {
 
    public double add(double x, double y) {
        return x + y;
    }
 
    public String myrun() {
        Animals animal = new Animals("pupu",27);
 
        XStream xstream;// = new XStream();
    //    String xml = xstream.toXML(animal);
        return "xml";
 
    }
 
}

to działa. Więc to raczej nie JSF. Jak by to był problem z JSF to by to też nie działało.

0

TO moze za moalo bledow nam pokazujesz

0

Konsola wypluwa mi coś takiego:

9:52:56,535 ERROR [stderr] (default task-4) javax.ejb.EJBException: JBAS014580: Unexpected Error
09:52:56,545 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)
09:52:56,545 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
09:52:56,546 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340)
09:52:56,551 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
09:52:56,552 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,553 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79)
09:52:56,564 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,571 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
09:52:56,572 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,573 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
09:52:56,573 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,574 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)
09:52:56,574 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,575 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
09:52:56,575 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,576 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
09:52:56,579 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,579 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
09:52:56,580 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,580 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
09:52:56,581 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,581 ERROR [stderr] (default task-4) 	at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
09:52:56,586 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,586 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
09:52:56,587 ERROR [stderr] (default task-4) 	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
09:52:56,588 ERROR [stderr] (default task-4) 	at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
09:52:56,588 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,588 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
09:52:56,589 ERROR [stderr] (default task-4) 	at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
09:52:56,589 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,594 ERROR [stderr] (default task-4) 	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
09:52:56,596 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
09:52:56,597 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:243)
09:52:56,597 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
09:52:56,611 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocation(EJBObjectInterceptor.java:58)
09:52:56,612 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
09:52:56,612 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocation(EJBHomeInterceptor.java:83)
09:52:56,613 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
09:52:56,615 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42)
09:52:56,616 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
09:52:56,617 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125)
09:52:56,620 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
09:52:56,620 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
09:52:56,622 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
09:52:56,624 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
09:52:56,636 ERROR [stderr] (default task-4) 	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
09:52:56,636 ERROR [stderr] (default task-4) 	at com.sun.proxy.$Proxy39.myrun(Unknown Source)
09:52:56,637 ERROR [stderr] (default task-4) 	at org.superbiz.jsf.CalculatorBean.myrun(CalculatorBean.java:65)
09:52:56,638 ERROR [stderr] (default task-4) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:52:56,641 ERROR [stderr] (default task-4) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
09:52:56,642 ERROR [stderr] (default task-4) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:52:56,648 ERROR [stderr] (default task-4) 	at java.lang.reflect.Method.invoke(Method.java:606)
09:52:56,648 ERROR [stderr] (default task-4) 	at com.sun.el.parser.AstValue.invoke(AstValue.java:275)
09:52:56,649 ERROR [stderr] (default task-4) 	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
09:52:56,649 ERROR [stderr] (default task-4) 	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
09:52:56,650 ERROR [stderr] (default task-4) 	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
09:52:56,650 ERROR [stderr] (default task-4) 	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
09:52:56,650 ERROR [stderr] (default task-4) 	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
09:52:56,654 ERROR [stderr] (default task-4) 	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
09:52:56,655 ERROR [stderr] (default task-4) 	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
09:52:56,656 ERROR [stderr] (default task-4) 	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
09:52:56,656 ERROR [stderr] (default task-4) 	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
09:52:56,657 ERROR [stderr] (default task-4) 	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
09:52:56,659 ERROR [stderr] (default task-4) 	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
09:52:56,660 ERROR [stderr] (default task-4) 	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
09:52:56,668 ERROR [stderr] (default task-4) 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
09:52:56,671 ERROR [stderr] (default task-4) 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
09:52:56,672 ERROR [stderr] (default task-4) 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
09:52:56,672 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
09:52:56,673 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
09:52:56,673 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
09:52:56,674 ERROR [stderr] (default task-4) 	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
09:52:56,680 ERROR [stderr] (default task-4) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
09:52:56,680 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
09:52:56,680 ERROR [stderr] (default task-4) 	at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
09:52:56,681 ERROR [stderr] (default task-4) 	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
09:52:56,681 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
09:52:56,682 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
09:52:56,682 ERROR [stderr] (default task-4) 	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
09:52:56,683 ERROR [stderr] (default task-4) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
09:52:56,687 ERROR [stderr] (default task-4) 	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
09:52:56,688 ERROR [stderr] (default task-4) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
09:52:56,688 ERROR [stderr] (default task-4) 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
09:52:56,689 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
09:52:56,696 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
09:52:56,696 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
09:52:56,697 ERROR [stderr] (default task-4) 	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
09:52:56,697 ERROR [stderr] (default task-4) 	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
09:52:56,697 ERROR [stderr] (default task-4) 	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
09:52:56,698 ERROR [stderr] (default task-4) 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
09:52:56,698 ERROR [stderr] (default task-4) 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
09:52:56,699 ERROR [stderr] (default task-4) 	at java.lang.Thread.run(Thread.java:745)
09:52:56,701 ERROR [stderr] (default task-4) Caused by: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/XStream
09:52:56,702 ERROR [stderr] (default task-4) 	at org.superbiz.jsf.CalculatorImpl.myrun(CalculatorImpl.java:48)
09:52:56,702 ERROR [stderr] (default task-4) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:52:56,702 ERROR [stderr] (default task-4) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
09:52:56,703 ERROR [stderr] (default task-4) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:52:56,703 ERROR [stderr] (default task-4) 	at java.lang.reflect.Method.invoke(Method.java:606)
09:52:56,704 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
09:52:56,705 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,706 ERROR [stderr] (default task-4) 	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
09:52:56,708 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
09:52:56,708 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,708 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
09:52:56,718 ERROR [stderr] (default task-4) 	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
09:52:56,718 ERROR [stderr] (default task-4) 	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
09:52:56,719 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
09:52:56,720 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,727 ERROR [stderr] (default task-4) 	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
09:52:56,728 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
09:52:56,732 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,732 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
09:52:56,732 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,733 ERROR [stderr] (default task-4) 	at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
09:52:56,733 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,734 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
09:52:56,734 ERROR [stderr] (default task-4) 	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
09:52:56,740 ERROR [stderr] (default task-4) 	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
09:52:56,741 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,742 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
09:52:56,744 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,745 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
09:52:56,746 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,758 ERROR [stderr] (default task-4) 	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
09:52:56,762 ERROR [stderr] (default task-4) 	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
09:52:56,762 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,763 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)
09:52:56,763 ERROR [stderr] (default task-4) 	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
09:52:56,764 ERROR [stderr] (default task-4) 	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)
09:52:56,764 ERROR [stderr] (default task-4) 	... 90 more
09:52:56,765 ERROR [stderr] (default task-4) Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.XStream from [Module "deployment.jsf-managedBean-and-ejb.war:main" from Service Module Loader]
09:52:56,768 ERROR [stderr] (default task-4) 	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
09:52:56,769 ERROR [stderr] (default task-4) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443)
09:52:56,769 ERROR [stderr] (default task-4) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431)
09:52:56,770 ERROR [stderr] (default task-4) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373)
09:52:56,780 ERROR [stderr] (default task-4) 	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118)
09:52:56,781 ERROR [stderr] (default task-4) 	... 126 more
 
0

Umie czytać?

Caused by: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/XStream

0

Co to znaczy?

0

http://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java

This is caused when there is a class file that your code depends on and it is present at compile time but not found at runtime. Look for differences in your build time and runtime classpaths.

0

Przepraszam, myślałem, że to jest polskojęzyczne forum.
Wybaczcie, że w dalszym ciągu, będę pisał po polsku. Tam nie ma rozwiązania dlaczego mimo podłączenia bulid path nie EJB nie widzi class.

0

Znalazłem w Eclipse jak się dodaje classpath do RunTime i to dalej nie działa.
Zrzut ekranu Eclipse jest w załączniku.

0

Pretensje do Jboss'a ze nie umie z eclipse classpath wyczytać....

0

Czy wie ktoś jak zmusić JBoss do tego, aby wczytał z Eclipse classpath?

0

Czy Eclipse i JBoss to są dość egzotyczne narzędzia, że nit nie umie mi pomóc się nimi posługiwać?

0

a dołącza w ogóle tą bibliotekę do wara? jak wygląda pom? czemu nie używasz JAXP/JAXB?

0

Na tym przykładzie chciałem się nauczyć, jak dodawać zewnętrznych bibliotek do ziaren EJB.
Nigdy wcześnie nie dodawałem zewnętrznych bibliotek do projektów Java EE. Wcześniej umiałem tylko dodawania do projektów JavaSE

0

Rozwiązałem ten problem następująco:

Utworzyłem następujące katalogi

 
$JBoss/modules/com/thoughtworks/xstream/main

Do tego katalogu skopiowałem następujące jar'y:

xmlpull-1.1.3.1.jar
xpp3_min-1.1.4c.jar
xstream-1.4.7.jar

**
Utworzyłem plik module.xml z zawartością:**

$ cat module.xml 
<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->

<module xmlns="urn:jboss:module:1.1" name="com.thoughtworks.xstream">
  <resources>
    <!-- Insert resources here -->
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>
 

i program się odpalił :)

To dziwne! Wygląda na to, że nikt na tym forum nie używa JBoss. W internecie i w podręcznikach jest napisane, że do bardzo popularny serwer aplikacji.

1 użytkowników online, w tym zalogowanych: 0, gości: 1