[JBoss Tools] - Using the RESTEasy Simple Project Example in JBDS 3
by Administrator Administrator
Administrator Administrator [http://community.jboss.org/people/admin] modified the document:
"Using the RESTEasy Simple Project Example in JBDS 3"
To view the document, visit: http://community.jboss.org/docs/DOC-14693
--------------------------------------------------------------
JAX-RS (JSR-311) is a new JCP specification that provides a Java API for RESTful Web Services over the HTTP protocol. Resteasy is a portable implementation of this specification which ships with EAP 5 and is supported by JBoss/Red Hat by subscription. This wiki is not meant to explain JAX-RS or RESTEasy, but to provide developers with a quickstart to get going with developing RESTEasy Web Services within JBoss Developer Studio (JBDS). For additional details about RESTEasy, please see the http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5.... RESTEasy Reference Guide.
(A good portion of this Wiki page was copied and modified from http://community.jboss.org/docs/DOC-14677 here - many thanks to Gary Lamperillo.)
>From JBDS you have access to a sample RestEasy web project to get you started.
First you have to decide whether you want to use m2eclipse (Eclipse/Maven integration) to resolve the RESTEasy dependencies in the sample project or manipulate the sample project's build path yourself. Both options are straightforward, but installing m2eclipse is the simpler path for getting the project up and running quickly.
To install m2eclipse:
1. In the main Eclipse menu, select Help -> Install New Software. This brings up the "Install" dialog.
2. Click "Add" to add a new update site to the list. Type "m2eclipse" as the Name and " http://m2eclipse.sonatype.org/update-dev/ http://m2eclipse.sonatype.org/update-dev/" as the Location. Click OK.
3. When the list of available software for install appears, click the box beside "Maven Integration" and click "Finish." Follow the remaining steps as prompted to ensure the software is installed properly.
To create the example project in your workspace:
1. In the Eclipse main menu, select Help -> Project Examples. This brings up the "New Project Examples" dialog, which provides many different sample projects.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1902... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
2. In the "New Project Examples" dialog, scroll to find "RESTEasy" and select the "RESTEasy Simple Example." Click "Finish" to continue.
3. The "Quick Fix" dialog appears, presenting a long list of things that need to be addressed to make the example work in your environment. Don't panic. We're going to fix one thing here and then the rest will be taken care of later in this process. (Note that if you use m2eclipse, you'll only see the Target runtime issue and have to fix that before you're up and running.
The first "fix" in the list is for the target runtime. Select it and click "Quick Fix."
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1903... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
4. This brings up the "Quick Fix" dialog. The target runtime the project is expecting doesn't exist in your environment, but we're going to point it to an EAP 5.0 or SOA-P 5.0 instance.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1904... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-... 1. If you already have a Targeted Runtime configured in your environment, you can select "Configure Targeted Runtimes" and click "Finish." This brings up the Properties dialog for the project. Select "Targeted Runtimes" and then check the box beside the runtime you've already created in the list. Click "OK" to close the dialog and move on.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1905... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
2. If you don't already have a Targeted Runtime configured, you can select "Create a new runtime environment" and click "Finish." This brings up a preferences dialog where you can configure a new Runtime Environment. Click "Add."
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1906... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-... This brings up the "New Server Runtime Environment" dialog. Select "JBoss Enterprise Middleware -> JBoss Enterprise Application Platform 5.0 Runtime." This is the same type you can use for both SOA-P 5.0 and EAP 5.0. Click "Next."
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1907... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-... Now you can give your new runtime a name (or go with the default) and select the Configuration Directory and server type. Just go with the defaults for now. Click "Finish" to return to the preferences dialog where you should see your new runtime in the list. Click "OK" to continue.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1908... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-... +Note: If you get back to the Quick Fix dialog and the Target runtime issue still exists after creating a new runtime in your environment, follow the steps from (a) above to resolve the problem.+
5. Now there are still issues in your "Quick Fix" list, but we'll resolve those in just a moment. Go ahead and click "Finish" to move on.
6. At this point, you have two options. If you installed m2eclipse, it should have already resolved the missing dependencies using Maven when the project was downloaded into your workspace. (You should be done with getting the project working now.) Skip ahead to step 10.
If not, you can modify the build path for your project with a three steps (7, 8, and 9) to resolve the dependencies via your local runtime. The benefit of defining and adding Build Path libraries to the project is that you will be able to reuse these libraries for other RESTEasy web service projects.
7. First, you have to add the JUnit 4 library to the project build path.
1. Right-click on the project. Select Build Path -> Configure Build Path in the popup menu.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1909... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
2. On the property page that appears, click "Add Library."
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1910... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
3. In the "Add Library" wizard dialog that appears, select "JUnit". Click "Next".
4. Specify JUnit 4 as the version and click "Finish".
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1911... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
5. Back on the property page, click OK.
8. Next, you need to add the RESTEasy libraries to the build path.
1. Right-click on the project. Select Build Path -> Configure Build Path in the popup menu.
2. On the property page that appears, click "Add Library."
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1912... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
3. In the "Add Library" wizard dialog that appears, select "User Library". Click "Next".
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1913... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
4. On the "User Library" page of the wizard, click the "User Libraries..." button.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1914... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
5. On the User Libraries Preferences page that appears, click "New."
6. Give it a name like "RESTEasy Libs" and click "OK."
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1915... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
7. Back on the User Libraries Preferences page, with your library selected, click "Add JARs..."
8. Navigate in the JAR Selection dialog to find your EAP 5 or SOA-P 5 runtime directory and locate the "resteasy/lib" directory beneath it. Select the following jars:
* jaxrs-api.jar
* jyaml.jar
* resteasy-atom-provider.jar
* resteasy-jaxb-provider.jar
* resteasy-jaxrs.jar
* resteasy-multipart-provider.jar
* resteasy-yaml-provider.jar
* scannotation.jar
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1916... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
9. Click "OK".
10. Back on the "Add Library" wizard page click "Finish".
11. Back on the property page, click OK.
9.
10. Lastly, you need to make sure your JUnit and RESTEasy Libs jars are added to the deployment package.
1. Right-click on the project. Select "Properties" in the popup menu.
2. Find and select "Java EE Module Dependencies" in the list on the left of the Properties dialog.
3. Look for "JUnit 4" and check the box beside it.
4. Look for your User Library "RESTEasy Libs" and check the box beside it.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1917... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
5. Click Apply and then OK or just OK. The JUnit 4 and RESTEasy libraries will now be deployed in the WEB-INF/lib folder automatically at deploy time.
11. At this point you should be able to Clean the example project and add it to the Server.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1918... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
12. To test the sample project, we'll need a REST client to test with. We have found the https://addons.mozilla.org/en-US/firefox/addon/9780 RESTClient plugin for Firefox (which comes from the Google Chrome Project) to be very useful. Download and install the plugin to perform the tests.
13. Let's give the Simple Shopping Application a Customer Record. Copy the following without spaces and CR/LF (to avoid xerces exceptions at the server) to the Request Body Section of the RESTClient:
<customer>
<first-name>Bill</first-name>
<last-name>Burke</last-name>
<street>256 Clarendon Street</street>
<city>Boston</city>
<state>MA</state><zip>02115</zip>
<country>USA</country>
</customer>
14. The Web.xml and the RestEasy Implementation Class are responsible for deciding what the final URL will look like and what methods are supported (again this is not a RESTEasy tutorial, go to the Reference Guide discussed for more info). The URL to use for this test case is http://localhost:8080/simple/rest-services/customers http://localhost:8080/simple/rest-services/customers. Using this url and a Post method, we will create the first customer record with the RESTClient.
+Note: You may need to add the following request header by selecting the "Add Request Header" button:+
+ name=content-type+
+ value=application/xml+
+This ensures the request content type is consumable by the service POJO.+
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1919... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
15. We can now use the Get Method and pass the id of 1 to get the first customer record. Click on the Response Body tab to see the same record that you previously posted to the server.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1920... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
16. Now Let's Update the record with the Put Method, copy the following to the Request Body, change the method to Put, and click Send:
<customer>
<first-name>Gary</first-name>
<last-name>Lamperillo</last-name>
<street>256 Clarendon Street</street>
<city>Venice</city>
<state>CA</state>
<zip>90291</zip>
<country>USA</country>
</customer>
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1921... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
17. Again verify that the Record has changed with a Get Method call on the Customer Record ID 1.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14693-4-1922... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14693-4-...
You have just completed a RESTEasy and JBDS tutorial, now you can take a rest!
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-14693]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years, 8 months
[JBoss Tools] - How to use the Python ant-to-Eclipse example converter scripts
by Administrator Administrator
Administrator Administrator [http://community.jboss.org/people/admin] modified the document:
"How to use the Python ant-to-Eclipse example converter scripts"
To view the document, visit: http://community.jboss.org/docs/DOC-16175
--------------------------------------------------------------
h2. Overview
Though it still doesn't have a great name, I've put together a set of Python scripts that will take an ANTified runtime example, such as one of the ESB examples, and convert it into an import-ready Eclipse project.
Why do we need this you may ask? Well, we have a subset of examples in the Project Examples functionality provided with JBoss Tools and JBoss Developer Studio. But it's just a subset. There are many more example projects provided with runtimes such as EAP and SOA-P that aren't there. Rather than have the same example represented in two different places, which has potential issues with keeping them in sync, we can simply take the original runtime example and transform it (one-way only) into a form that Eclipse recognizes.
The scripts aren't perfect. But it's a start.
h2. Where to find them...
For now, I've put the script into a workspace directory in the JBoss Tools SVN repository:
http://https://anonsvn.jboss.org/repos/jbosstools/workspace/bfitzpat/org.... https://anonsvn.jboss.org/repos/jbosstools/workspace/bfitzpat/org.jboss.t...
The project was created using the PyDev plug-ins for Eclipse, so if you have that installed you can load them into Eclipse. But you can also run them from the command line like any other Python script.
Once you've checked out the project, drill into it and find the src directory. There you'll find all the scripts.
You will need to customize *constants.py* file to match your environment and the *Main.py* file to point to the examples you want to convert, but once you've done that just type the following at the command line:
>python Main.py
You will see something like the following if the script is correctly configured for your runtime:
http://community.jboss.org/servlet/JiveServlet/showImage/102-16175-1-1068... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-16175-1-...
h2. How to Customize the scripts...
To make the script work, you'll need to have a server runtime instance in the Servers view already created. The converted project requires the name of that server for various settings in project configuration files.
In the *constants.py* file, you'll find one constant you'll need to change - runtimeTargetServerName. Change the quoted name to the name of your server and save the file.
runtimeTargetServerName = 'My Server'
Now to tell the script which examples to convert, you can update the *Main.py* file. I've set up a "localruntime" variable for the path of the examples directory in your runtime. And then all you have to do is add the directory names for the examples to convert.
So if your local runtime samples directory is at /usr/home/runtime/samples and you want to convert "MyExample", the code would look something like this:
# change this list to be appropriate to your own runtime directory and
# list of projects to convert
localruntime = '/usr/home/runtime/samples'
toconvert.append('MyExample')
You can add as many examples as you want. But be aware that it creates a parallel example in the same directory for each Eclipse project. So "MyExample" becomes "MyExample_eclipse" in the same samples directory. And it will delete the new example project directory if it already exists, so make sure you back it up first if you want to keep it.
h2. Additional Customizations...
I have tested the script on several ESB examples that are shipped with the SOA-P runtime. The list includes: deadletter, helloworld_file_action, helloworld_file_notifier, and helloworld_ftp_action (among with a few others). These are basic examples that don't include additional runtimes such as Drools. So there is still work to be done here.
If you look into the *file_handler.py* script, you can see multiple methods for dealing with the creation or copying of specific files. The *dir_handler.py* script handles various directories. And methods in both are called by *converter.py*, which is the main class used to convert the projects.
You can add your own files and directories and customizations (for Drools or other requirements) as necessary. And we will eventually build out these scripts to handle as many of the available runtime examples as possible.
h2. Once the conversion is done...
Once the *Main.py* script is run and your examples are converted, you can import them in Eclipse using the File->Import->Existing Projects into Workspace menu.
h2. Finally...
The goal of these scripts is not to be an ultimate solution, but to provide a more automated way of bringing existing runtime examples into the Eclipse tooling. Hopefully they will mature over time, but in the meantime provide some basic functionality to help out users both new and old start to explore more JBoss functionality via the tooling.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-16175]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years, 8 months
[JBoss Tools] - Project Examples Creation and Strategy
by Administrator Administrator
Administrator Administrator [http://community.jboss.org/people/admin] modified the document:
"Project Examples Creation and Strategy"
To view the document, visit: http://community.jboss.org/docs/DOC-15834
--------------------------------------------------------------
(THIS IS A WORK IN PROGRESS STARTED SEPTEMBER 14, 2010)
h2.
h2. Overview
JBoss Tools and JBDS provide access to numerous zipped project examples via the Help->Project Examples menu. Each project example appears in a category that organizes them into broad groups for ESB, Seam, BPEL, and so on. When the user selects one of the examples and clicks Finish, the example is imported into their workspace and (if the "Show the Quick Fix dialog" box is checked) work through some of the available quick fixes to help the example work in their environment.
There are three criteria for each project example...
1. The zip for the project example is essentially the exported archive file for an Eclipse project.
2. A project examples XML file registered for JBoss Tools or JBDS using the org.jboss.tools.project.examples.projectExamplesXml extension point.
3. An entry in the XML file describing the project and any special requirements.
h3. Project Example Zip File
The project example zip file is created by right-clicking on a project in the Package Explorer or Project Explorer and selecting Export on the popup menu. In the Export dialog, select General -> Archive File and click Next. Provide a path and file name for the archive file, specify which files should be in the archive, and click Finish.
These project example zip files may be contained in the SVN repository in a workspace directory such as " http://anonsvn.jboss.org/repos/jbosstools/workspace/myworkspace/myexample... http://anonsvn.jboss.org/repos/jbosstools/workspace/myworkspace/myexample..." or it may be found in the http://download.jboss.org/jbosstools/examples http://download.jboss.org/jbosstools/examples directory on the server.
NOTE: WE NEED TO SPECIFY WHERE THE EXAMPLE ZIP SHOULD BE LOCATED - JBT vs. JBDS.
h3. Registered Project Examples XML File
There are a few project examples xml files that exist today. When adding a new example, it should be added to the lowest possible project example xml version it can work with. If it's a new example that doesn't work in an existing version, a new example xml is created and that is added as an additional example file.
For instance, if you are adding a new ESB example that will run on JBoss Tools version 3.1 (i.e. ESB 4.7 is supported), go ahead and add it to http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam....
However, if you're adding a new example for Teiid Designer, which didn't exist before JBoss Tools version 3.2, you would create a new project-examples-3.2.xml file if it didn't already exist. So the file would become http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam.... Or if we end up with a version 3.3 and add new functionality there, we'd create http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam.... And so on and so forth... This is an additive process.
Knowing what the target tooling platform will be is important, as what a project will "work with" is different between JBDS and JBoss Tools. For example, JBDS examples cannot use Maven since we don't have Maven plug-ins installed, but Maven can be used for JBoss Tools examples because Maven works in that environment.
Examples for JBDS should try and use jars from the actual supported runtimes instead of bundling them - JBoss Tools can be more liberal here.
If you add a new project example file, it needs to be registered so it can be found when the user uses the Project Examples wizard.
*How Do I Publish A New XML File?*
Once your file is ready to be published on download.jboss.org (rather than anonsvn.jboss.org), contact mailto:nboldt@redhat.com nboldt(a)redhat.com or open a JIRA assigned to Nick Boldt. You can also ping him on IRC (freenode channel #jbosstools or Red Hat channel #devstudio). Publishing the file is done via this script: http://anonsvn.jboss.org/repos/jbosstools/trunk/download.jboss.org/jbosst... http://anonsvn.jboss.org/repos/jbosstools/trunk/download.jboss.org/jbosst...
h4. Registering a new Project Examples XML File
We currently register example xml files in the org.jboss.tools.community.project.examples plug-in in SVN. You can find it at http://anonsvn.jboss.org/repos/jbosstools/trunk/examples/plugins/org.jbos... http://anonsvn.jboss.org/repos/jbosstools/trunk/examples/plugins/org.jbos....
Currently there are two file URLs registered in org.jboss.tools.community.project.examples...
* http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam...
* http://download.jboss.org/jbosstools/examples/project-examples-bpel-3.1.xml http://download.jboss.org/jbosstools/examples/project-examples-bpel-3.1.xml
To add another file, simply add a new instance of the "org.jboss.tools.project.examples.projectExamplesXml" extension point.
<extension
point="org.jboss.tools.project.examples.projectExamplesXml"
name="My New Example File">
<url>MY-EXAMPLE-XML-FILE-URL</url>
<experimental>false</experimental>
</extension>
h3. New Entry in Project Examples XML File
Once you know which file to add your new example to, you can create a new entry for your example. Each of these files follows the same pattern - the root is <projects> and each new entry is a <project>. For example:
<projects>
<project>
<category>My Category Display Name</category>
<name>My Project Example Name</name>
<included-projects>NAME-OF-THE-PROJECT-EXPORTED-IN-THE-ZIP-FILE</included-projects>
<shortDescription>Brief Description</shortDescription>
<description>Long Description</description>
<size>22645</size> <!-- size of the zip file -->
<url>MY-ZIP-FILE-URL</url>
</project>
</projects>
Let's break this down a little.
* The <category> tags are used to provide the high-level grouping in the tree of the Project Examples wizard. For instance, if you have "My Category" as the category and "My Example" as the <name> of the project, you should see "My Category -> My Example" appear in the tree.
* The <name> tags are used to provide the display name for the Project Example. This does not need to be the same as what is included in the file itself as the actual project name.
* The <included-projects> tags contain the actual names of the projects in the zip file. It is important to get the name exactly right or the Project Examples wizard will not be able to successfully import the project.
* NOTE: I don't know where the <shortDescription> is actually used in the wizard.
* The <description> tags contain the description text displayed on the Project Examples wizard page when the project is selected.
* The <size> tags are used to display the file size of the example zip to give the user an idea of how big a file it is.
* The <url> tags contain the actual URL to the project example zip. The project example engine uses Eclipse ECF Framework so the URLs can be ftp, http, https (with and without authentication), a local file, etc.
NOTE: WE ALSO NEED TO DOCUMENT HOW TO USE THE <fixes> TAGS:
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.42</property>
<property name="eclipse-projects">registration,registration-ejb,registration-ear</property>
<property name="description">This project example requires the JBoss EAP 4.3 or JBoss AS 4.2.x</property>
</fix>
<fix type="seam">
<property name="allowed-versions">2.0.0, 2.0.1, 2.0.2</property>
<property name="eclipse-projects">registration</property>
<property name="description">This project example requires Seam version 2.0</property>
</fix>
<fix type="plugin">
<property name="id">org.testng.eclipse</property>
<property name="versions">5.8.0, 5.9.0</property>
<property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse http://beust.com/eclipse</property>
</fix>
</fixes>
h2. General Tips
Here are some general tips for how to setup the examples:
* Don't require users to download multiple examples, if one can suffice (i.e. initially one example = one project, that is not the case anymore. one example can contain multiple examples. Many of the ESB examples suffers from this)
* Do not refer to specific named JDK's, use Execution environments (this removes the need for any quickfixing when it comes to jdk and java runtime matching)
* Server runtimes do not have execution environments so use the names our installer/runtimesetup will most likely give them so it will be found automatically.
* Make sure to use the quickfix options to express what range of servers/runtimes it will work with.
h2. Still to Work In:
> My second set of questions goes back to JBIDE-5645 and the issue I was seeing where the versions of the files in http://download.jboss.org/jbosstools/examples http://download.jboss.org/jbosstools/examples doesn't match what's in SVN.
>
> If we're pointing the community examples file at http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... instead of http://download.jboss.org/jbosstools/example/project-examples-3.1.xml http://download.jboss.org/jbosstools/example/project-examples-3.1.xml, that explains the differences.
We should not be pointing to any examples in svn since svn locations are not stable. If we are that is a bug.
> As we add more and more examples, we really need to standardize a process for getting new ones into the mix and how we migrate the older ones forward.
>
> Do we have a strategy in place? If not, we seriously need to develop one quickly. Each time we release and add more examples, this mess will get bigger.
No strategy beyond above and yes we should get it written down since so many seem to think svn is a great place to store this even though it will constantly break.
Optimally we would push these to the maven repo instead and get them from there but right now download.jboss.org is where it is at.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15834]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years, 8 months
[JBoss Tools] - possible bug org.eclipse.swt.SWTError: Item not added
by nimo stephan
nimo stephan [http://community.jboss.org/people/nimo22] created the discussion
"possible bug org.eclipse.swt.SWTError: Item not added"
To view the discussion, visit: http://community.jboss.org/message/582759#582759
--------------------------------------------------------------
I updatet my rf-tools to actual 3.2 cr1. Now my ide crashes with the following stacktrace and I cannot click the right mouse button anywhere (even in windows explorer!) until I destroy the eclipse java from the task manager.
eclipse.buildId=M20100909-0800
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
Error occurred during status handling
org.eclipse.swt.SWTError: Item not added
at org.eclipse.swt.SWT.error(SWT.java:4109)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
at org.eclipse.swt.widgets.Menu.createItem(Menu.java:516)
at org.eclipse.swt.widgets.MenuItem.<init>(MenuItem.java:91)
at org.jboss.tools.common.model.ui.action.XModelObjectAction.createMenuItem(XModelObjectAction.java:140)
at org.jboss.tools.common.model.ui.action.XModelObjectActionList.fillMenu(XModelObjectActionList.java:77)
at org.jboss.tools.jst.web.ui.navigator.XActionProvider$XContributionItem.fill(XActionProvider.java:129)
at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:737)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:818)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:678)
at org.eclipse.ui.internal.menus.WorkbenchMenuService.updateManagers(WorkbenchMenuService.java:330)
at org.eclipse.ui.internal.WorkbenchWindow.liftRestrictions(WorkbenchWindow.java:3068)
at org.eclipse.ui.internal.WorkbenchWindow$28.shellActivated(WorkbenchWindow.java:3106)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:88)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1635)
at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2114)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4157)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.DestroyWindow(Native Method)
at org.eclipse.swt.widgets.Control.destroyWidget(Control.java:684)
at org.eclipse.swt.widgets.Shell.destroyWidget(Shell.java:697)
at org.eclipse.swt.widgets.Widget.release(Widget.java:818)
at org.eclipse.swt.widgets.Widget.dispose(Widget.java:446)
at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:447)
at org.eclipse.swt.widgets.Shell.dispose(Shell.java:714)
at org.eclipse.jface.window.Window.close(Window.java:335)
at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:979)
at org.eclipse.jface.dialogs.TrayDialog.close(TrayDialog.java:179)
at org.eclipse.ui.internal.statushandlers.InternalDialog.close(InternalDialog.java:710)
at org.eclipse.jface.dialogs.Dialog.okPressed(Dialog.java:940)
at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
at org.eclipse.ui.internal.statushandlers.InternalDialog.buttonPressed(InternalDialog.java:190)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.showStatusAdapter(WorkbenchErrorHandler.java:107)
at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.handle(WorkbenchErrorHandler.java:57)
at org.eclipse.ui.internal.ide.IDEWorkbenchErrorHandler.handle(IDEWorkbenchErrorHandler.java:106)
at org.eclipse.ui.internal.WorkbenchErrorHandlerProxy.handle(WorkbenchErrorHandlerProxy.java:36)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:189)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:231)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:242)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopException(WorkbenchAdvisor.java:326)
at org.eclipse.ui.internal.ExceptionHandler.handleException(ExceptionHandler.java:65)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2644)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Is this bug already published?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/582759#582759]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 8 months
[JCA] - (JCA PoolFiller:) Unable to fill pool
by Werner Dijkerman
Werner Dijkerman [http://community.jboss.org/people/wdijkerman] created the discussion
"(JCA PoolFiller:) Unable to fill pool"
To view the discussion, visit: http://community.jboss.org/message/569127#569127
--------------------------------------------------------------
Hi,
Last weekend we had the following error:
2010-10-29 17:10:10,987 WARN org.jboss.resource.connectionmanager.JBossManagedConnectionPool org.jboss.resource.connectionmanager.JBossManagedConnectionPool (JCA PoolFiller:) Unable to fill pool
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection reset)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:512)
at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Io exception: Connection reset
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
... 4 more
I can't find any information why this was happening. Can somebody explain that?
I Couldn't find any information out there on the web ...
Server: Jboss 4.05 GA
Thanks.
Kind regards,
Werner
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569127#569127]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 8 months
[JBoss AOP] - Cannot intercept a method
by bbarin
bbarin [http://community.jboss.org/people/bbarin] created the discussion
"Cannot intercept a method"
To view the discussion, visit: http://community.jboss.org/message/582723#582723
--------------------------------------------------------------
Hi
I've developed a simple aspect to measure the performance of my application, but althogh the deployment of the aspect in JBoss looks correct, the method that's aimed is not intercepted. I used the following approach:
- I have a performance.jar which contains the following aspect:
package com.agfa.ogpc.performance.aspects;
import com.agfa.ogpc.performance.dao.NeoDatisMessageProcessingDAO;
import com.agfa.ogpc.performance.dao.PerformanceDAO;
import org.jboss.aop.joinpoint.MethodInvocation;
import com.agfa.ogpc.performance.model.TimeElapsed;
public class MessageProcessingAspect {
public Object intercept(final MethodInvocation invocation) throws Throwable {
long startTime = System.currentTimeMillis();
try {
return invocation.invokeNext();
} finally {
long endTime = System.currentTimeMillis();
store(new TimeElapsed(startTime,endTime));
}
}
private void store(final TimeElapsed timeElapsed) {
PerformanceDAO<TimeElapsed> dao = new NeoDatisMessageProcessingDAO();
dao.persist(timeElapsed);
}
}
- I also have several .ears which are part of my application
- I deployed a file named performance-aop.xml in the deploy folder, that looks like:
<?xml version="1.0" encoding="UTF-8"?>
<aop>
<aspect class="com.agfa.ogpc.performance.aspects.MessageProcessingAspect"/>
<bind pointcut="execution(* com.agfa.hap.bpe.components.db.BasicStatelessDBComponent->*(..))">
<around aspect="com.agfa.ogpc.performance.aspects.MessageProcessingAspect" name="intercept" />
</bind>
</aop>
The application is deployed correctly and the -aop.xml is wellformed, but the application is not intercepted and I'm sure the method is being called (I debugged the code).
Then I have changed the syntax to intercept any method:
<?xml version="1.0" encoding="UTF-8"?>
<aop>
<aspect class="com.agfa.ogpc.performance.aspects.MessageProcessingAspect"/>
<bind pointcut="execution(* *->*(..))">
<around aspect="com.agfa.ogpc.performance.aspects.MessageProcessingAspect" name="intercept" />
</bind>
</aop>
But even after this change the aspect is not being called. I also tried to change the performance.jar to performance.aop and include a jboss-aop.xml within the META-INF folder, but without any success.
So, I ran out of options for the moment.... So, anyone has any idea how to solve it?
Thanks,
Bruno
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/582723#582723]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 8 months