[JBoss Tools] - Learn Java EE 6 quickly using JBoss Central
by Snjezana Peco
Snjezana Peco [https://community.jboss.org/people/snjeza] modified the blog post:
"Learn Java EE 6 quickly using JBoss Central"
To view the blog post, visit: https://community.jboss.org/community/tools/blog/2011/12/18/learn-java-ee...
--------------------------------------------------------------
The *JBoss Central* editor includes several quickstarts that provide a quick run-through of Java EE 6 features.
The quickstarts are based on amazing Pete Muir's JBoss AS7 quickstarts - https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Appl... JBoss AS 7.0 - Getting Started Developing Applications Guide
and are adapted to work with Eclipse/JBoss Tools.
This blog guides you how to install *JBoss Tools 3.3* and start work with Java EE 6 using these tutorials.
h4. Installing JBoss Tools 3.3
In order to install *JBoss Tools 3.3*, you need to perform the following steps:
* install http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/ind... Eclipse Java EE IDE for Web Developers Download the appropriate archive for your OS, unpack it and start Eclipse.
* Call *Help>Install New Software*..., click the *Add* button and enter the following update site:
http://download.jboss.org/jbosstools/updates/development/indigo/ http://download.jboss.org/jbosstools/updates/development/indigo/
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17647/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
* select the *Abridged JBoss Tools 3.3* category https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17648/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Click *Next*, *Next*, check "*I accept the terms of the license agreements*" and click *Finish*.
* Wait for Eclipse to download and install the *JBoss Tools 3.3*.
* Restart Eclipse when required.
You have installed *JBoss Tools 3.3*.
h4. JBoss Quickstarts (JBoss Central)
After Eclipse restarts, you will get the *JBoss Central* editor.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17598/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-175...
Expand the *JBoss Quickstart* widget in the *Project Examples* section
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17599/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-175...
The *helloworld, numberguess, login and kitchensink* quickstarts will guide you through creating a Java EE 6 application.
Here I will describe to you how to create the *helloworld* application. The rest of the applications are used in a similar way, but they introduce new concepts as shown in the following figures:
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17600/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17601/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17602/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17603/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
The *HTML5* is a template project that doesn't include any cheat sheet.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17604/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
h4. Helloworld quickstart
In order to create the *helloworld* Java EE 6 application, you have to do the following:
1. click the *Helloworld* project example in the *JBoss Central* editor https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17605/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
2. *JBoss Tools* will warn you that you have to install JBoss AS 7.0 or 7.1 in order to create, deploy and run this application.
If you have already installed and configured JBoss AS 7.x, you won't see any requirement and will be able to skip to the step *3*.
* If you have already downloaded JBoss AS 7.x, you will be able to configure it using the *Install* button. https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17606/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Add the directory where you downloaded your JBoss AS and *JBoss Tools* will configure a JBoss AS 7.x server for you.
* If you don't have any JBoss AS 7.x server, click the *Download and Install...* button and *JBoss Tools* will, for you, download JBoss AS 7.0.2
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17607/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17608/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
3. When the JBoss AS is installed and configured, you will get the following dialog: https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17609/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Click the *Start* button.
The *jboss-as-helloworld* project will be imported and you will get the *helloworld* cheat sheet that will help you to review the application.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17610/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17611/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Read the introduction to learn how the application works and click *Click to Begin*.
The following screen will appear:
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17612/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
After reading a detailed description, click *Click when complete*.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17613/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
The *HelloWorldServlet.java* section explains the *HelloWorld* servlet in detail. When clicking the action, the cheat sheet will open the appropriate section of the code.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17614/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Run or skip all the actions in the *HelloWorldServlet.java* section. You will get the *HelloService.java* section.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17615/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Click *Click to perform*. The following screen will show up:
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17616/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
That's it. You are ready to deploy and run the application on the JBoss AS 7 server you previously installed and configured.
Click *Click to perform*
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17617/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Click *Next*
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17618/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
Finally, click the *Finish* button.
The cheat sheet will start the server, deploy the application and open it in a browser.
https://community.jboss.org/servlet/JiveServlet/showImage/38-4362-17619/j... https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4362-176...
In a similar way, you will be able to create and review the *numberguess*, *login* and *kitchensink* applications. *Kitchensink* is an especially interesting application. In addition to explaining many Java EE 6 features (CDI, JSF, EJB, JTA, Bean Validation, JAX-RS, Arquillian), it automatically runs an Arquillian test and enables you to create your starting project.
Some advanced Java EE developers might also be interested in reviewing this application.
images/jeeblog24.png images/jeeblog24.png
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/community/tools/blog/2011/12/18/learn-java-ee...]
12 years, 12 months
[JBoss Web Services] - AS 7.1CR1b jboss-webservices.xml
by h-igel-cs
h-igel-cs [https://community.jboss.org/people/h-igel-cs] created the discussion
"AS 7.1CR1b jboss-webservices.xml"
To view the discussion, visit: https://community.jboss.org/message/647668#647668
--------------------------------------------------------------
Hello.
I want to update my old AS 6.1 Project to AS 7.1 Full Profile and read different migration how-to docs. One Problem I have is to customize the context root of the SLSB EJBs. In the previous versions I used the jboss.xml, which now is deprecated and not working any more. The partially alternative is the jboss-webservices.xml. In jboss.xml this context-root change was achieved with
<webservices>
<context-root>/TestProjectEE</context-root>
</webservices>
In jboss-webservices.xml it should be done with the same elements:
My file looks like that:
<?xml version="1.0" encoding="UTF-8"?>
<webservices>
<context-root>/TestProjectEE</context-root>
</webservices>
Then I got:
Caused by: java.lang.IllegalStateException: Unexpected element: webservices
at org.jboss.wsf.spi.metadata.webservices.JBossWebservicesFactory.parse(JBossWebservicesFactory.java:168)
at org.jboss.wsf.spi.metadata.webservices.JBossWebservicesFactory.load(JBossWebservicesFactory.java:117)
... 8 more
I changed the namespace suffix:
<?xml version="1.0" encoding="UTF-8"?>
<jboss:webservices>
<context-root>/TestProjectEE</context-root>
</jboss:webservices>
And then:
Caused by: java.lang.IllegalStateException: Unexpected element: context-root
at org.jboss.wsf.spi.metadata.webservices.JBossWebservicesFactory.parse(JBossWebservicesFactory.java:168)
at org.jboss.wsf.spi.metadata.webservices.JBossWebservicesFactory.load(JBossWebservicesFactory.java:117)
... 8 more
Is it a namespace-issue?
I have seen, that there is a @WebContext Annotation from a jboss-module available, which I didn't tested. But the optimal solution for me would be to change the context-root in a descriptor file.
Furthermore the FAQ must be changed, because it references to the obsolete jboss.xml
https://community.jboss.org/docs/DOC-13646#How_do_I_know_what_endpoint_ad... https://community.jboss.org/wiki/JBossWS-FAQ#How_do_I_know_what_endpoint_...
Of course someone of you knows what the solution for this problem is.
Thank you very much
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/647668#647668]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 12 months
[jBPM] - Listener not call when complete a task
by gardellajp
gardellajp [https://community.jboss.org/people/gardellajp] created the discussion
"Listener not call when complete a task"
To view the discussion, visit: https://community.jboss.org/message/647691#647691
--------------------------------------------------------------
Hi,
I have a problem related to loggers attached to a loaded session, they are not called when I complete a task. There are the steps:
1) Start a process:
<<<< CODE >>>>
//Create the session
StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, envoriment);
CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task",handler);
//add logger
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);
//start a new process
session.startProcess("myprocess");
//close resources
logger.close();
session.dispose();
<<<< END CODE >>>>
At this point, console logger works and in console I see what are happening.
2) End some Task
Later, in the app, I choose a task and I want complete it.
<< CODE>>>
TaskClient client = obtainATaskClient();
client.getTask(taskId,handler);
Task task = handler.getTask();
//obtain the session
int sessionId = task.getTaskData().getProcessSessionId();
StatefulKnowledgeSession session = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId,knowledgeBase, null, envoriment);
CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task",handler);
//add logger
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);
//complete the task
client.complete(taskId, userId, outputData, responseHandler);
isDone = responseHandler.waitTillDone(time);
logger.close();
session.dispose();
<<< END CODE >>>>
The problem is that in the step 2, the logger never call. How can I make the step 2 works? I see in console that the handler is call becouse I see the generated sql.
Thanks,
Juan
|
|
|
|
|
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/647691#647691]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 12 months
[jBPM] - Re: Where can I find API's for jBPM console UI?
by Surendar Sadhasivam
Surendar Sadhasivam [https://community.jboss.org/people/surendarmx] created the discussion
"Re: Where can I find API's for jBPM console UI?"
To view the discussion, visit: https://community.jboss.org/message/648099#648099
--------------------------------------------------------------
Hi,
I am working in the example,
http://community.jboss.org/people/bpmn2user/blog/2011/09/21/jbpm5-web-exa... http://community.jboss.org/people/bpmn2user/blog/2011/09/21/jbpm5-web-exa...
To Run and Deploy,
Use maven to create a war file (e.g., mvn package) and copy the war file to TOMCAT_HOME/webapps
I am new to use Maven.
While using maven(mvn package), I got the following error,
"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building jbpm5webexample Maven Webapp
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 3 source files to C:\Surendar_work\18.01.12\WorkSpaces\JBPM5web
examples\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\drools\drools-core\5.2.0.M1\drools-core-5.2.0.M1.jar; error in opening zip
file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\drools\drools-api\5.2.0.M1\drools-api-5.2.0.M1.jar; error in opening zip f
ile
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\drools\drools-persistence-jpa\5.2.0.M1\drools-persistence-jpa-5.2.0.M1.jar
; error in opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\hibernate\hibernate-annotations\3.4.0.GA\hibernate-annotations-3.4.0.GA.ja
r; error in opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\hibernate\hibernate-commons-annotations\3.1.0.GA\hibernate-commons-annotat
ions-3.1.0.GA.jar; error in opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\hibernate\ejb3-persistence\1.0.2.GA\ejb3-persistence-1.0.2.GA.jar; error i
n opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\hibernate\hibernate-core\3.3.0.SP1\hibernate-core-3.3.0.SP1.jar; error in
opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\jbpm\jbpm-flow-builder\5.0.0\jbpm-flow-builder-5.0.0.jar; error in opening
zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\jbpm\jbpm-flow\5.0.0\jbpm-flow-5.0.0.jar; error in opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\jbpm\jbpm-persistence-jpa\5.0.0\jbpm-persistence-jpa-5.0.0.jar; error in o
pening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\jbpm\jbpm-human-task\5.0.0\jbpm-human-task-5.0.0.jar; error in opening zip
file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\jbpm\jbpm-workitems\5.0.0\jbpm-workitems-5.0.0.jar; error in opening zip f
ile
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\hornetq\hornetq-transports\2.0.0.GA\hornetq-transports-2.0.0.GA.jar; error
in opening zip file
error: error reading C:\Documents and Settings\surendar_sadhasivam\.m2\repositor
y\org\jbpm\jbpm-bam\5.0.0\jbpm-bam-5.0.0.jar; error in opening zip file
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Jan 23 12:00:50 IST 2012
[INFO] Final Memory: 13M/32M
"
Please help me in this issue
Thanks in adv !
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/648099#648099]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 12 months
[jBPM] - dataInputAssociation <assignment> expressions
by M Arnold
M Arnold [https://community.jboss.org/people/marnold] created the discussion
"dataInputAssociation <assignment> expressions"
To view the discussion, visit: https://community.jboss.org/message/647913#647913
--------------------------------------------------------------
Hi,
I'm struggling to map input parameters to my task from process variables. I can't find much documentation besides http://docs.jboss.org/jbpm/v5.2/userguide/ch05.html#sec.data 5.8.1. Data, and the BPMN2 spec from OMG is cryptic.
I have a task something like this:
<task id="_4" tns:taskName="Custom" name="sendCustom">
<incoming>_2-_4</incoming>
<outgoing>_4-_5</outgoing>
<ioSpecification id="InputOutputSpecification_1">
<dataInput id="_4_messageInInput" name="messageIn" />
<dataOutput id="_4_messageOutOutput" name="messageOut" />
<inputSet id="InputSet_1">
<dataInputRefs>_4_messageInInput</dataInputRefs>
</inputSet>
<outputSet id="OutputSet_1">
<dataOutputRefs>_4_messageOutOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation id="DataInputAssociation_2">
<sourceRef>event</sourceRef>
<targetRef>_4_messageInInput</targetRef>
<assignment id="Assignment_2">
<from xsi:type="tFormalExpression" id="FormalExpression_3">.</from>
<to xsi:type="tFormalExpression" id="FormalExpression_4">.</to>
</assignment>
</dataInputAssociation>
<dataOutputAssociation id="DataOutputAssociation_1">
<sourceRef>_4_messageOutOutput</sourceRef>
<targetRef>resultMessage_4</targetRef>
</dataOutputAssociation>
</task>
Where 'event' is a process variable. So what can I put in the <assignment><to> and <from>? An XPath expression? What if it's not XML? When I can I use #{event}? What are the valid values for from@xsi:type besides "tFormalExpression"?
When I execute this task as it is above, I get:
Caused by: java.lang.NullPointerException
at org.jbpm.bpmn2.xpath.XPATHAssignmentAction.execute(XPATHAssignmentAction.java:91)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.handleAssignment(WorkItemNodeInstance.java:193)
... 81 more
I'm sorry if this is a very basic or broad question. I've scoured the web and really can't find many examples.
Thanks in advance for help.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/647913#647913]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 12 months