Unable to deploye ejb3 project on eclipse mars - eclipse

I am developing an EJB 3.0 application on eclipse mars. I am unable to deploy project on glassfish 4 server. I use JDK 7.
My server log:
cannot Deploy SampleEJBProject
deploy is failing=Error occurred during deployment: Exception while deploying the app [SampleEJBProject] : A MultiException has 2 exceptions. They are:
1. com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.web.weld-integration [296]], State = [RESOLVED]
2. java.lang.IllegalStateException: Could not load descriptor SystemDescriptor(
implementation=org.glassfish.weld.WeldContainer
name=org.glassfish.weld.WeldContainer
contracts={org.glassfish.weld.WeldContainer,org.glassfish.api.container.Container}
scope=javax.inject.Singleton
qualifiers={}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=Bundle-SymbolicName={org.glassfish.main.web.weld-integration},Bundle-Version={4.1.1}
rank=0
loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.web.weld-integration [296]], State = [RESOLVED],377949866)
proxiable=null
proxyForSameScope=null
analysisName=null
id=414
locatorId=0
identityHashCode=2094253683
reified=false)
. Please see server.log for more details.
Please help me.
I am referring this link for developing application
https://www.genuitec.com/products/myeclipse/learning-center/javaee/myeclipse-ejb-3-x-tutorial/

The problem got resolved automatically.

Related

Drools KIE workbench 7: error when saving kmodule.xml file in 'Knowledge Base Settings' page

In drools KIE workbench 7, for a project 'testRemoteKJar', I use 'Knowledge Base Settings:Knowledge bases an sessions' to edit its kmodule.xml, as in below screen shot.
Screen Shot--Knowledge Base Settings.
When I click button 'save' to save kmodule.xml, the console of the KIE workbench print below error message.
08-Jul-2017 19:29:00.161 INFO [Thread-12] org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder.updateResource Incremental build request received for: default://master#repo-demorules/testRemoteKJar/src/main/resources/META-INF/kmodule.xml (updated).
08-Jul-2017 19:29:00.317 INFO [Thread-607] org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.execute Incremental build request being processed: PathImpl{uri='default://master#repo-demorules/testRemoteKJar', fileName='testRemoteKJar', attrs={}} (updated).
08-Jul-2017 19:29:00.325 SEVERE [Thread-13] org.kie.workbench.common.screens.impl.LibraryIndexer.fillIndexBuilder Unable to index default://master#repo-demorules/testRemoteKJar/src/main/resources/META-INF/kmodule.xml: package could not be resolved.
08-Jul-2017 19:29:00.726 SEVERE [Thread-607] org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages Unable to build KieBase, could not find include: kbase1
And if I download the jar file 'testRemoetKJar' from KIE workbench, the content of the kmodule.xml in that jar is just one line:
<kmodule xmlns="http://www.drools.org/xsd/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
The error log contains words 'package could not be resolved', but the project 'testRemoteKJar' does have package 'org_care.crm.testremotekjar' (the package name is used in the screenshot above). So the error log should have other meaning.
How to fix the error? Thanks a lot.

eclipse and gradle: do not deploy test classes

We have here a JEE Vaadin project in eclipse (neon) IDE and as build system we use gradle. But we have a problem with our test classes. If we build our war/ear with gradle all is fine. The test classes are not part of the war archive.
But if we want to deploy the ear project on the wildfly server from inside of eclipse it seems that the test classes are part of the war archive. Because while deploy the ear we getting some errors like:
...
Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.LinkageError: Failed to link com/coco_on/docFlow/vaadin/admin/TestAdminRoles (Module "deployment.DFl_EAR.ear.DFl_Vaadin.war:main" from Service Module Loader)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49)
at org.jboss.weld.resources.DefaultReflectionCache.getBackedAnnotatedTypeAnnotationSet(DefaultReflectionCache.java:169)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.getAnnotations(BackedAnnotatedType.java:112)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.getAnnotation(BackedAnnotatedType.java:98)
at org.jboss.weld.bootstrap.BeanDeployer.processPriority(BeanDeployer.java:105)
at org.jboss.weld.bootstrap.BeanDeployer.processAnnotatedTypes(BeanDeployer.java:174)
at org.jboss.weld.bootstrap.BeanDeployment.createTypes(BeanDeployment.java:224)
at org.jboss.weld.bootstrap.WeldStartup.startInitialization(WeldStartup.java:381)
at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:76)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:92)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
... 3 more
Caused by: java.lang.NoClassDefFoundError: com/vaadin/testbench/TestBenchTestCase
...
TestAdminRoles is one of our test classes and TestBenchTestCase is one of the needed classes in a test framework (Vaadin Testbench). But this test framework will be not found and this is also ok, because we don't want link this library into the ear/war.
We have also read this post: https://stackoverflow.com/a/9820317/1465758
So we have removed the src/test/ directories from the deployment and set a different bin directory for the test source directories. But without success. The error above is still there.
And so my question is: How can I configure eclipse so that eclipse don't put the compiled test classes to the war file?
You need to change the output-folder of the sourcefolders for test-sources and remove the test-directories from the deployment assembly.
This should be added to the build.gradle. (the eclipse-plugin needs to be also applied)
eclipse {
// change output dir of the sourcefolders
classpath.file.whenMerged {
entries.findAll { it instanceof org.gradle.plugins.ide.eclipse.model.SourceFolder }.each {
it.output = 'build/eclipse/' + (it.path.startsWith('src/test') ? 'output-test' : 'output')
}
}
// removes test dirs from deployment assemble
wtp.component.file.whenMerged {
wbModuleEntries.removeIf {
it instanceof org.gradle.plugins.ide.eclipse.model.WbResource && it.sourcePath.startsWith('/src/test')
}
}
}
Code Source (small changes where applied)
In this example the output-directory from non test-sources are also changed, that all output-directories are inside the build-directory from Gradle.

Deploying application in domain failed; White spaces are required between publicId and systemId

While deploying any war file in glassfish server 2.1 I am getting the below issue. I have done with small sample web application with hello world in a welcome jsp file in that case as well getting the same issue. Already running war I have undeployed and tried to deploy again. Still the same issue. OS is Solaris.
Deploying application in domain failed; Error loading deployment descriptors for module [repreg_nov2] Line 1 Column 50 -- Deployment descriptor file WEB-INF/web.xml in archive [repreg_nov2]. White spaces are required between publicId and systemId. Error loading deployment descriptors for module [repreg_nov2] Line 1 Column 50 -- Deployment descriptor file WEB-INF/web.xml in archive [repreg_nov2]. White spaces are required between publicId and systemId
I have deleted the glassfish domain and created again Still the same issue...Please help me ...
Using the version 2.0 in web.xml solves the problem, it works.

libgdx can't start desktop project on ubuntu

so, I just created libgdx project for desktop and imported it (gradle) to eclipse. When I launch it this error pops up:
Exception in thread "LWJGL Application" java.lang.ExceptionInInitializerError
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:446)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:118)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:954)
at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
... 2 more
AL lib: (EE) alc_cleanup: 1 device not closed
I can't figure out what's happening. Project's created for android and launched in android studio working properly.
You need to install the xorg-xrandr package, see
http://badlogicgames.com/forum/viewtopic.php?f=11&t=18801
This is a known issue, try to install xorg-xrandr.
Also, I fixed this issue by installing bumblebee.
This error disappeared for me after I switched from the default lwjgl backend (that is for some reason still used in the tool to generate a LibGDX project) to lwjgl3 backend. This is how you do it for a project freshly generated with gdx-setup.jar (doc):
In build.gradle change
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
to
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
In DesktopLauncher class, change
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new Game(), config);
to
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
new Lwjgl3Application(new Game(), config);
and modify imports to
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
so basically just add 3 after lwjgl in those two places.

Problem deploying Seam application in JBoss 6

I'm trying to deploy a simple "hello world" Seam application on JBoss 6, and I'm getting these errors on the log:
Deployment "jboss.ejb3:application=helloworld,component=TimerServiceDispatcher,module=jboss-seam,service=EjbEncFactory" is in error due to the following reason(s): Described
Deployment "org.jboss.ejb.bean.instantiator/helloworld/jboss-seam/TimerServiceDispatcher" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.jboss.ejb.bean.instantiator/helloworld/jboss-seam/TimerServiceDispatcher' **
Deployment "jboss.naming:application=helloworld,component=TimerServiceDispatcher,module=jboss-seam" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.naming:application=helloworld,component=TimerServiceDispatcher,module=jboss-seam' **
Deployment "org.jboss.ejb.bean.instantiator/helloworld/jboss-seam/EjbSynchronizations" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.jboss.ejb.bean.instantiator/helloworld/jboss-seam/EjbSynchronizations' **
Deployment "jboss.ejb3:application=helloworld,component=EjbSynchronizations,module=jboss-seam,service=EjbEncFactory" is in error due to the following reason(s): Described
Deployment "jboss.naming:application=helloworld,component=EjbSynchronizations,module=jboss-seam" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.naming:application=helloworld,component=EjbSynchronizations,module=jboss-seam' **
Evidently the deployment process can't find TimerServiceDispatcher and EjbSynchronizations , but I registered them in web.xml :
<ejb-local-ref>
<ejb-ref-name>helloworld/EjbSynchronizations/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
<ejb-link>EjbSynchronizations</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>helloworld/TimerServiceDispatcher/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.async.LocalTimerServiceDispatcher</local>
<ejb-link>TimerServiceDispatcher</ejb-link>
</ejb-local-ref>
What am I doing wrong, or what am I missing? and notice that the deployer is looking for the components in /helloworld/jboss-seam/TimerServiceDispatcher and not in /helloworld/TimerServiceDispatcher (same thing with EjbSynchronizations)
Found the solution, it was a problem with the packaging. The jboss-seam.jar library was in the lib directory inside the .ear file of the project; this no longer works in JBoss 6, as that file must now reside at the root level inside the .ear. Also, the location of jboss-seam.jar in application.xml must be adjusted accordingly.