[Beginner's Corner] - Migration from AS5 to AS7.1
by Aston Chan
Aston Chan [https://community.jboss.org/people/astonchan] created the discussion
"Migration from AS5 to AS7.1"
To view the discussion, visit: https://community.jboss.org/message/716922#716922
--------------------------------------------------------------
Hi,
I am getting this when deploying an existing war file to AS7.1:
14:24:54,061 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/FindTemperature]] (MSC service thread 1-5) Error configuring application listener of class gmsjsp.rtvdisplay: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:99) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:78) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3342) [jbossweb-7.0.7.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.7.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:77) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
Caused by: java.lang.IllegalStateException: Failed to invoke constructor
at org.jboss.msc.value.ConstructedValue.getValue(ConstructedValue.java:65)
at org.jboss.as.naming.ValueManagedReferenceFactory$1.getInstance(ValueManagedReferenceFactory.java:63)
at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:91) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_27]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_27]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_27]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_27]
at org.jboss.msc.value.ConstructedValue.getValue(ConstructedValue.java:61)
... 23 more
Caused by: java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/JPEGImageEncoder
at gmsjsp.rtvdisplay.<init>(SourceFile:40) [classes:]
... 28 more
Caused by: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder from [Module "deployment.FindTemperature.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 29 more
14:24:54,066 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/FindTemperature]] (MSC service thread 1-5) Skipped installing application listeners due to previous error(s)
14:24:54,066 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Error listenerStart
14:24:54,067 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Context [/FindTemperature] startup failed due to previous errors
14:24:54,068 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.deployment.default-host./FindTemperature: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host
./FindTemperature: failed to start context
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:82)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
14:24:54,269 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015856: Undeploy of deployment "FindTemperature.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./Fi
ndTemperature" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./FindTemperature: failed to start context"}}
14:24:54,337 INFO [org.jboss.as.server.deployment] (MSC service thread 1-10) Stopped deployment FindTemperature.war in 68ms
14:24:54,338 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./FindTemperature: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./FindTemperature: failed to start context
14:24:54,339 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jbos
s.web.deployment.default-host./FindTemperature" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./FindTemperature: failed to start context"}}}}
If I edit the modules\sun\jdk\main\module.xml by adding :
<path name="com/sun/image/codec/jpeg"/>
, then my war file will be deployed properly. I didn't want to modify the installed AS7.1 module.xm and hence tried to create my own jboss-deployment-structure.xml under the META-INF\ folder. The jboss-deployment-structure.xml looks like:
*<jboss-deployment-structure>*
*<deployment>*
* <dependencies>*
* <module name="sun.jdk">*
* <imports>*
* <include-set>*
* <path name="com/sun/image/codec/jpeg"/>*
* </include-set>*
* </imports>*
* </module>*
* </dependencies>*
*</deployment>*
*</jboss-deployment-structure>*
That didn't help.
Can you help me with this? The same war file deployed properly on AS5.x.
Thanks.
-Aston
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/716922#716922]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[JNDI and Naming] - Lookups from jboss 7 to jboss 4
by Carlos Rodríguez
Carlos Rodríguez [https://community.jboss.org/people/caalroja] created the discussion
"Lookups from jboss 7 to jboss 4"
To view the discussion, visit: https://community.jboss.org/message/721367#721367
--------------------------------------------------------------
Hello, a couple years ago I created and deployed 2 applications that work together on jboss 4. Now, I want to migrate one of them (because the other one is too coupled to jboss 4) to jboss 7 but I have a problem when I make the lookups calls. When I make a lookup on my current server (jboss 7) everything works good, but when I try to make the jboss 4 lookups this message is shown
17:35:06,898 ERROR [stderr] (http--127.0.0.1-8080-4) javax.naming.NameNotFoundException: map-server/ClientBean/remote -- service jboss.naming.context.java.map-server.ClientBean.remote
17:35:06,902 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
17:35:06,902 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)
17:35:06,902 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)
17:35:06,903 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:213)
17:35:06,903 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.naming.InitialContext.lookup(InitialContext.java:392)
- My original Initial Context code (when the the app was on jboss 4) was this:
Properties env = new Properties();
env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
env.put("java.naming.provider.url", url);
InitialContext ctx = new InitialContext(env);
and I used to make the lookups this way:
client = (Client) ctx.lookup("Appear/ClientBean/remote");
- My new Initial Context code (Jboss 7) is this:
Properties env = new Properties();
env.put("java.naming.factory.initial", "org.jboss.as.naming.InitialContextFactory"); //this change
env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
env.put("java.naming.provider.url", Params.getValue("com.ogangi.mimampp3.NAMING_PROVIDER_URL"));
InitialContext ctx = new InitialContext(env);
and a I still make same the lookups:
client = (Client) ctx.lookup("Appear/ClientBean/remote");
Any Idea?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/721367#721367]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - How to get current node instance in a workitem handler?
by Affan Dar
Affan Dar [https://community.jboss.org/people/affandar] created the discussion
"How to get current node instance in a workitem handler?"
To view the discussion, visit: https://community.jboss.org/message/729676#729676
--------------------------------------------------------------
We need to persist per processinstance+nodeinstance data during the execution of a workitem. There are quite a few use cases for this:
1) The workitemhandler needs to store some state that it can use to build some additional guarantees in the face of server restarts/crashes.
E.g., in some FireMissileWorkItemHandler() I want to log the fact that the missile was already fired so that if the server crashed before jbpm hits the next persist point and the same process is restarted, the workitemhandler can lookup the state and see that it had already fired a missile. Of course this will not give us an exactly-once guarantee since the server can crash before it checkpointed but this way we give the workitem developers some more control.
2) A workitem handler generates some intermediate data that should be logged/persisted.
Here is the problem: the index for this data should be {processinstanceid, nodeid} since these are the only two things that will remain the same if the process instance is restarted after a crash. The workitemid that is available in a workitemhandler is regenerated if the workitem was executed again on a process restart. Now, within a workitemhandler I could not find any way to extract the node id of the currently executing node or the current node instance. Note that this is readily available for script tasks via kcontext.getNodeInstance(). I don't know why the same is not available for a workitem handler.
In addition to the persistence scenario, another use case for a node id in workitemhandler is that a workitem handler itself needs to generate a signal to a compensation handler. In this case, I want to say something like this in the workitemhandler code:
ksession.signalEvent("Compensate-" + current_node_id, null);
Again, it requires access to the current node id.
Is this an interesting scenario for the community as well? How did other folks resolve this?
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/729676#729676]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[JBoss Tools] - Re: JBoss tools does not put impl classes on classpath for AS7
by henk de boer
henk de boer [https://community.jboss.org/people/henk53] created the discussion
"Re: JBoss tools does not put impl classes on classpath for AS7"
To view the discussion, visit: https://community.jboss.org/message/717616#717616
--------------------------------------------------------------
> Max Rydahl Andersen wrote:
>
> Note, adding everything is not the solution.
Max, just wondering what you exactly mean by this. Do you mean adding everything by default to the standard JBoss server runtime, or providing an optional JBoss server runtime that includes everything?
As mentioned, I agree that it might be a good idea to only provide API classes in the standard runtime (shield most developers from accidentally linking to implementation classes).
But if you mean the second thing, I don't see how not adding everything would not be a solution for advanced developers who simply need everything?
Currently the AS 6 runtime includes almost everything, but you guys have forgotten a few jars here and there and indeed me and some of the other developers on my team have run into problems missing exactly those (if I remember correctly, it was e.g. the timerservice in common/deploy/ and some Tomcat related classes). The workaround is to add those jars to your project's classpath, but don't export them to the deployment. This allows you to do ctrl-t, call hierarchies, etc. It's a bit of a hassle, as basically you do want to keep those jars out of version control, so you have uncommitted changes in your project all the time and have to redo this at every location you work.
The point is that there are always cases developers run into. I find it hard to think of any jar or class in JBoss that should always and permanently be 'hidden'.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/717616#717616]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months