[JBoss Tools] - m2e(clipse)-wtp 0.13.0 : New & Noteworthy
by Fred Bricon
Fred Bricon [http://community.jboss.org/people/fbricon] modified the blog post:
"m2e(clipse)-wtp 0.13.0 : New & Noteworthy"
To view the blog post, visit: http://community.jboss.org/community/tools/blog/2011/06/23/m2eclipse-wtp-...
--------------------------------------------------------------
h3. Embracing Indigo
So, Eclipse 3.7 a.k.a. Indigo has been released. This year, 62 Eclipse projects were made available on the same day. Part of the release train is M2E 1.0.0, which succesfully graduated from the Eclipse incubator. Congrats to all the teams involved!
m2e-wtp 0.13.0 is finally available as well. Last minute bugs prevented an earlier release and m. As you will discover, the WTP integration with Maven is thighter than ever! The complete release notes are available here (https://issues.sonatype.org/secure/ReleaseNote.jspa?projectId=10310&versi...), but let's take a quick look at what's new and noteworthy :
h3. Discovery / installation
Once m2e is installed, there are several ways to install m2e-wtp. First you need to wipe the m2eclipse-extras update site from your memory (and eclipse), it only contains m2e 0.12.0 compatible plugins :
1) Import existing Java EE projects into the workspace; You'll be proposed to install the m2e-wtp plugin :
http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3913-1657... (http://community.jboss.org/servlet/JiveServlet/showImage/38-3913-16576/m2...)
click on Finish and the installation will proceed. Your projects will be imported but the workspace will have to be restarted.
2) Go to Window > Preferences > Maven > Discovery and click on "Open catalog". Select m2e and proceed with the installation.
3) Old school installation : Use this update site : https://repository.sonatype.org/content/sites/forge-sites/m2eclipse-wtp/0...
h3. Experimental war overlay support
Finally, after all these years, m2e-wtp offers support for http://maven.apache.org/plugins/maven-war-plugin/overlays.html maven war overlays. The idea is to share common resources between several web applications. One use case could be to easily share logos, style sheets etc... in a corporate environment. All you need to do is declare in your web application pom.xml a dependency to another war artifact.
<project xmlns=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar</groupId>
<artifactId>war</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>foo.bar</groupId>
<artifactId>overlaid</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</project>
By default, all the contents of the overlaid artifact will be copied to the deployment directory of the web application, minus the MANIFEST.MF. *The resources of the web application take precedence, in case of duplicate files*.
If your project depends on a war archive (from your local repository), that dependency will be unzipped under target/m2e-wtp/overlays/<dependency>/ before being deployed to your server, according to the overlay configuration (you can select what files are included/excluded). For instance :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<overlays>
<overlay>
<groupId>foo.bar</groupId>
<artifactId>overlaid</artifactId>
<excludes>
<exclude>WEB-INF/lib/*</exclude>
</excludes>
</overlay>
</overlays> </configuration>
</plugin>
... won't deploy the jars from overlaid (project or archive)/WEB-INF/lib
If the dependency is another web project in your workspace, the deployed resources will be dynamically determined from the overlay configuration and any file changed in the overlaid project will be automatically redeployed to the target server.
Below is an example where the "war" project depends on an "overlaid" war project and hudson-war-2.0.1.war(before you asked, it's because this one is available in central). The images/hudson.png file is present in both overlay artifacts. The file is picked from "overlaid", since it's declared first in the pom. The deployed "war" project is a fully fledged CI server
http://community.jboss.org/servlet/JiveServlet/showImage/38-3913-16569/wa... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3913-1656...
As of now, unsupported features of war overlays are :
- filtering
- exclusions of resources from the main project (defined as <overlay></overlay>)
There's plenty of room for performance optimizations, and it still needs to be tested "on the field" so please, please, do not consider this feature as production ready, it's still experimental.
Also note that the WTP overlay metadata format (in .settings/org.eclipse.wst.common.component) has changed and is incompatible with older development builds of m2e-wtp 0.13.0. So if you used previous nightly builds, you should reimport your projects without their eclipse metadata (.project, .classpath, .settings/)
h3. Removal of WTP classpath libraries
http://community.jboss.org/servlet/JiveServlet/showImage/38-3913-16570/cl... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3913-1657...
Since its infancy, m2e-wtp suffered from outstanding classpath resolution issues when unit tests were being run. It turned out some dependencies were being leaked by the WebApp and EAR classpath libraries, installed by default on Java EE projects. Having these libraries also required extra code complexity to move workspace dependencies from one library to the other. In m2e-wtp, a rather radical solution was taken : remove these WTP libraries after they're being automatically added by WTP. Guess what? it solved all the classpath issues occurring during tests and simplified the code. So from now on, you will just see the following libraries in the project explorer
:
h3.
h3. 'Deployed Resources' node in the Project View
http://community.jboss.org/servlet/JiveServlet/showImage/38-3913-16572/de... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3913-1657...
Previous m2-wtp versions displayed a *Web Resources* node, for Web projects, or *Application Resources* for EARs, in the Project View. These nodes aggregate the content that must be deployed on the server / packaged in the final archive. A *Web Resources* node is already provided by JBoss Tools for projects having the JSF Facet installed. So, in order to avoid confusion, the nodes contributed by m2e-wtp have been renamed more appropriately to *Deployed Resources* :
h3. Maven-generated MANIFEST.MF
Up until now, in m2e-wtp, the manifest was generated "manually" using WTP's API, for web projects only. In the process, the man
ifest kinda fixed some maven shortcomings in order to handle skinny wars (didn't add a classpath prefix for EJBs, contrary to maven). Now, for Web, EAR, EJB, Utility and Connector projects, the manifest is generated via a call to the Maven's archiver.
That means no more impedance mismatch between Maven and Eclipse manifests. http://maven.apache.org/shared/maven-archiver/index.html Manifest customization is reflected on the fly in the generated file.
For jar, ejb and connector projects, it is generated under target/classes. For web projects, it goes under
target/m2e-wtp/web-resources/ and for EARs, goes under target/m2e-wtp/ear-resources/
http://community.jboss.org/servlet/JiveServlet/showImage/38-3913-16571/ma... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3913-1657...
Since the EAR library is gone, the manifest is no longer used to reflect compile classpath within Eclipse and is only used for runtime classpath resolution.
Since it now follows the same rules as Maven, how do you handle skinny wars with EJBs and classpath prefix? One solution is to use your own Class-Path entry, which will be appended with the classpath computed by the maven archiver. So, for instance :
will generate something like :
Manifest-Version: 1.0 Built-By: fbriconBuild-Jdk: 1.6.0_24Class-Path: sample-ejb-0.0.1-SNAPSHOT.jar lib/sample-util-0.0.1-SNAPSH OT.jarCreated-By: Maven Integration for Eclipse
Of course, the *"Created-By: Maven Integration for Eclipse"* entry can be overwritten using your own value :
Finally, we tried to delete all MANIFESTS.MFs automatically generated by WTP. So hopefully, your source control shouldn't be polluted anymore.
h3. Support for EAR Resource filtering
m2e-wtp now supports http://maven.apache.org/plugins/maven-ear-plugin/examples/filtering-sourc... EAR resource filtering, pretty much the same way http://community.jboss.org/en/tools/blog/2011/05/03/m2eclipse-wtp-0120-ne... Web projects do. Just add the filtering attribute to your maven-ear-plugin configuration :
http://community.jboss.org/community/tools/blog/2011/06/23/m2eclipse-wtp-.... http://community.jboss.org/community/tools/blog/2011/06/23/m2eclipse-wtp-....
</configuration>
</plugin>
</plugins>
</build>
Filtered resources are generated under target/m2e-wtp/ear-resources/
http://community.jboss.org/servlet/JiveServlet/showImage/38-3913-16573/ea... http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3913-1657...
h3. Dropped support for Eclipse 3.5 and older versions
In order to support war overlays, m2e-wtp 0.13.0 is taking advantage of several APIs that were made available in Eclipse 3.6 ( Helios). The direct consequence is it's not longer compatible with Eclipse 3.5 (Galileo) based platforms and of course older versions. However it's been tested against Eclipse 3.6 and 3.7 on the continuous integration server at JBoss.
h3. Now, what next?
Well, we're gonna see how the overlay support stands in the wild. If necessary, one or more 0.13.x bugfixes can be made available "quickly". One of the problem that delayed this release is a https://bugs.eclipse.org/bugs/show_bug.cgi?id=350138 conflict between m2e-wtp and the pom properties configurator. This lead us to remove the latter from m2e marketplace catalog to avoid confusion. I hope we can find a solution quickly in order to restore that plugin in the marketplace.
Next version (0.14.) should include Dali support, Application Client packaging support, bug fixes and https://issues.sonatype.org/browse/MECLIPSEWTP#selectedTab=com.atlassian.... more...
As always, if you find any issue or would like to see new useful features in m2e-wtp, please open a ticket at https://issues.sonatype.org/browse/MECLIPSEWTP https://issues.sonatype.org/browse/MECLIPSEWTP
Enjoy,
Fred.
PS: Again, special kudos to Igor Fedorenko who supported me during this not-so-trivial release.
--------------------------------------------------------------
14 years, 9 months
[Beginner's Corner] - New to JBoss - problem with clusters
by Andy Knott
Andy Knott [http://community.jboss.org/people/andyknott] created the discussion
"New to JBoss - problem with clusters"
To view the discussion, visit: http://community.jboss.org/message/611288#611288
--------------------------------------------------------------
Evening
Im a college student who is studying integrsation patterns, and want to look to practice some of my skills using the JBoss application server - so I've download the version 6 product.
Whilst I've got he basic server working, I'm struggling to find detailed resources about how to configure JBoss correctly.
I've installed 2 VMs and I've installed Apache with mod_jk, and I'm trying to get clustering to work -however when I try to start JBoss on two different machines I get the following errors message continually appearing - which I know are related to the hornetq component (which is related to messaging that I'm notusing at this stage)
2011-06-21 18:35:06,984 WARN [org.hornetq.core.cluster.impl.DiscoveryGroupImpl] (hornetq-discovery-group-thread-dg-group1) There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node.
Now I have started the Jboss instance using the command
run -c all -b 'IP address' -djboss.messaging.serverpeerid=1 on the first node, and peerid=2 on the second node (these are running on W2008 servers).
Can someone please clarify:
- if there is a simple way of setting different node IDs in an XML file - and clarify which XML file this should be - on the basis that I'm using JBoss 6.0.0.
- is there a simple way of disabling the hornetq component, since I don't need it at this stage?
Any help would be gratefully appreciated - as I've spent all day on this.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/611288#611288]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 9 months
[jBPM] - Problem with persistence, rules & fireUntilHalt
by Demian Calcaprina
Demian Calcaprina [http://community.jboss.org/people/calca] created the discussion
"Problem with persistence, rules & fireUntilHalt"
To view the discussion, visit: http://community.jboss.org/message/611719#611719
--------------------------------------------------------------
Hi All,
I have simple flow like this:
Start->Ruleflow->...
And I am running it with persistence. I am running the process in this way:
ProcessInstance process = session.createProcessInstance(
"pid", parameters);
session.insert(process);
long processInstanceId = process.getId();
new Thread(new Runnable() {
public void run() {
session.fireUntilHalt();
}
}).start();
session.startProcessInstance(processInstanceId);
And it breaks after executing the activation (I can see that the right side of the rule is run, as I put a variable in the process and it is there after the execution):
Exception in thread "Thread-6" org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.common.RuleFlowGroupImpl$DeactivateCallback@645ccb
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)
at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1036)
at org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:777)
at org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:753)
at org.drools.command.runtime.rule.FireUntilHaltCommand$1.run(FireUntilHaltCommand.java:50)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:259)
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:597)
at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)
at $Proxy20.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
at org.jbpm.persistence.JpaProcessPersistenceContext.getProcessInstancesWaitingForEvent(JpaProcessPersistenceContext.java:39)
at org.jbpm.persistence.processinstance.JPASignalManager.getProcessInstancesForEvent(JPASignalManager.java:40)
at org.jbpm.persistence.processinstance.JPASignalManager.signalEvent(JPASignalManager.java:23)
at org.jbpm.process.instance.ProcessRuntimeImpl$3.afterRuleFlowGroupDeactivated(ProcessRuntimeImpl.java:335)
at org.drools.event.AgendaEventSupport.fireAfterRuleFlowGroupDeactivated(AgendaEventSupport.java:168)
at org.drools.common.RuleFlowGroupImpl.setActive(RuleFlowGroupImpl.java:148)
at org.drools.common.RuleFlowGroupImpl$DeactivateCallback.execute(RuleFlowGroupImpl.java:301)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994)
... 5 more
If I run it with fireAllRules() after starting the process, it works fine, so I think it may be related with the new thead that the reactive mode uses. Do I may have some problems with my session persistence configuration? Here is the code of my test:
public class ProcessExecutionTest {
static {
ProcessBuilderFactory
.setProcessBuilderFactoryService(new ProcessBuilderFactoryServiceImpl());
ProcessRuntimeFactory
.setProcessRuntimeFactoryService(new ProcessRuntimeFactoryServiceImpl());
}
private PoolingDataSource ds1;
private EntityManagerFactory emf;
@Before
public void setUp() throws Exception {
ds1 = new PoolingDataSource();
ds1.setUniqueName("jdbc/testDS1");
ds1.setClassName("org.h2.jdbcx.JdbcDataSource");
ds1.setMaxPoolSize(3);
ds1.setAllowLocalTransactions(true);
ds1.getDriverProperties().put("user", "sa");
ds1.getDriverProperties().put("password", "sasa");
ds1.getDriverProperties().put("URL", "jdbc:h2:mem:mydb");
ds1.init();
ds1.init();
emf = Persistence
.createEntityManagerFactory("org.jbpm.persistence.jpa");
}
private KnowledgeBase createKnowledgeBase() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder();
kbuilder.add(
new ClassPathResource("myflow.bpmn"),
ResourceType.BPMN2);
kbuilder.add(
new ClassPathResource("myrule.drl"),
ResourceType.DRL);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
if (kbuilder.hasErrors()) {
StringBuilder errorMessage = new StringBuilder();
for (KnowledgeBuilderError error : kbuilder.getErrors()) {
errorMessage.append(error.getMessage());
errorMessage.append(System.getProperty("line.separator"));
}
Assert.fail(errorMessage.toString());
}
return kbase;
}
@Test
public void testAccrualProcessExceeded() throws Exception {
KnowledgeBase kbase = createKnowledgeBase();
EntityManagerFactory emf = Persistence
.createEntityManagerFactory("org.jbpm.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager());
final StatefulKnowledgeSession session = JPAKnowledgeService
.newStatefulKnowledgeSession(kbase, null, env);
new JPAWorkingMemoryDbLogger(session);
KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);
JPAProcessInstanceDbLog log = new JPAProcessInstanceDbLog(env);
session.getWorkItemManager().registerWorkItemHandler("Human Task",
new WorkItemHandler() {
public void executeWorkItem(WorkItem workItem,
WorkItemManager manager) {
Map variables = log.findVariableInstances(processInstanceId);
for (Iterator iterator = variables.iterator(); iterator.hasNext();) {
VariableInstanceLog variableInstanceLog = (VariableInstanceLog) iterator
.next();
System.out.println(variableInstanceLog);
}
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/611719#611719]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 9 months
[JBoss Web Services] - JBoss Native WS - problem with Abstract class as output Parameter in WebService
by prakash pethe
prakash pethe [http://community.jboss.org/people/prakash_pethe] created the discussion
"JBoss Native WS - problem with Abstract class as output Parameter in WebService"
To view the discussion, visit: http://community.jboss.org/message/611596#611596
--------------------------------------------------------------
I've a problem to use abstract class in a Web Service like WebMethod output parameter.
*Environment:*
- jboss-5.1.0.GA
- eclipseHelios
-windowsXp- SP3
I'm using JBOSS-5.1.0.GA and java runtime Version 6. It always return emtpry tag for abstract tag.
I have completed below step as wellWhen running under Java 6 you need to manually copy the following libraries from the JBOSS_HOME/client directory to the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:
jbossws-native-saaj.jar
jbossws-native-jaxrpc.jar
jbossws-native-jaxws.jar
jbossws-native-jaxws-ext.jar
for below section of WSDL:
<xsd:complexType name="Personne" abstract="true" />
<xsd:complexType name="PersonnePhysique">
<xsd:complexContent>
<xsd:extension base="*Personne*">
<xsd:complexType name="*PersonnePhysique*">
<xsd:complexContent>
<xsd:extension base="Personne">
<xsd:sequence>
<xsd:element name="idFonctionnel" type="IdFonctionnel" maxOccurs="1"
minOccurs="1" />
<xsd:element name="civilite" type="Civilite" maxOccurs="1"
minOccurs="0" />
minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Below is ant target we are using to generate code.
<target name="consume" depends="init" >
<echo message="Génération des classes à partir du WSDL"/>
<wsconsume
fork="true"
verbose="true"
destdir="${classes.dir}"
sourcedestdir="${srcgen.dir}"
keep="true"
extension ="true"
wsdl="../${wsdl.dir}/${wsdlName}"/>
</target>
We actualy using Personne as response from web service.
Getting below error stack:
*javax.xml.ws.WebServiceException: javax.xml.bind.UnmarshalException: Unable to create an instance of com.sfr.sigc.rechercherpersonneetroles.Personne*
* with linked exception:
[java.lang.InstantiationException]
at org.jboss.ws.core.jaxws.JAXBDeserializer.handleUnmarshallException(JAXBDeserializer.java:110)
at org.jboss.ws.core.jaxws.JAXBDeserializer.deserialize(JAXBDeserializer.java:78)
at org.jboss.ws.core.binding.DeserializerSupport.deserialize(DeserializerSupport.java:58)
at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:179)
at org.jboss.ws.core.soap.XMLContent.transitionTo(XMLContent.java:96)
at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentElement.java:140)
at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElementDoc.java:85)
at org.jboss.ws.core.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:172)
at org.jboss.ws.core.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:261)
at org.jboss.ws.core.EndpointInvocation.getReturnValue(EndpointInvocation.java:195)
at org.jboss.ws.core.CommonClient.syncOutputParams(CommonClient.java:511)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:397)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
at $Proxy309.rechercherPersonneEtRoles(Unknown Source)
The same was working fine with CXF stack before. Please suggest solution without changinf WSDL as we can't chnage that.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/611596#611596]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 10 months