Jboss Fuse 6.2, install custom features to profile in fabric - apache-karaf

I was able to do what I'm goin to describe in Fuse 6.1 but now in Fuse 6.2 I get an exception and it is not working anymore.
By following a tutorial, I build a "multi module" project that has a features component in order to install all the needed bundles.
I'm working on a fabric container with a child container.
I create a new profile and then from hawtio console I try to add the feature repository. (BTW I have the same problem if I use the terminal console)
The feature repository is added correctly (that's what fuse says at least) but when I enter the page to add any feature I see this in the log:
org.eclipse.aether.resolution.ArtifactResolutionException: Could not
find artifact it.mytria.demo:esercizio1-feature:xml:features:1.0.0 in
karaf-default
(file:C:/servers/fuse/system/)
Of course, it is right, since I never installed the bundle in that folder, but I have it in my local .m2/repository
Now, the question is, has anyone ever installed a custom feature in Jboss 6.2 and can help me get out from this situation?
The only solution I found is to manually copy the feature and all the custom bundled indicated by the feature in the "/system" folder, but I never had to do this in Fuse 6.1 so I don't like this solution at all.
Other thing, there is a conf file in Fuse 6.2 that has changed from Fuse 6.1, C:\servers\fuse\etc\io.fabric8.maven.cfg and it is the only file I found pointing to the system folder... but I'm afraid that if I add the .m2 folder here then Fuse will try to search there any bundle even those that has to be really taken from system folder.
So far I haven't find any other difference in the config file about maven repository.
There is any good guy out there that know how to make this thing work?
Please, if I missed some important information, let me know, I'll try my best to complete the question.
Thank you very much.

I installed a clean JbossFuse 6.2.0. Then from the hawtio console I just add the repository to the profile using
mvn:it.mytria.demo/esercizio1-feature/1.0.0/xml/features
and it worked.
So... I have no idea what went wrong the first time. I made no changes to the projects code or pom configuration of the bundles.

Related

Bundles don't automatically create their .yaml files

I've been trying to create and setup a project under Symfony 4.4 for a few hours now but it seems like i'm getting a problem when i'm downloading bundles or installing things (For example, Doctrine or FOSrest).
Multiple times in tutorials I've seen that all the people seemed to have files such as "Doctrine.yaml" which are supposed to be stored in config/packages. And it seems like these configuration files are automatically created upon downloading the files associated to it.
But in my case there's simply... nothing, I have to create manually all the files, and i'm not sure if that's normal and if not, how can I resolve this problem ?
And it seems like these configuration files are automatically created upon downloading the files associated to it.
You're looking for the Symfony recipes which allow composer packages via Symfony/flex to automate common tasks when you install a new bundle.
A more detailed explanation regarding how does flex work you'll find in the official documentation here when it was first introduced in Symfony 3.4, but note that is not maintained anymore for this version.
I corrected it. I simply was being too dumb. When I created the git repository, I did the installation wrong and I didn't immediatly notice that I was downloading things into the wrong repository.
Thanks for all the answers!

Is there a direct way to get a full ejb/servlet application example for glassfish

I have an application that is currently running on JBoss AS but does not work on Glassfish. I'm trying to work through the documentation here but I'm having trouble figuring out things like what the file structure of the application should be and what (if any) additional files are needed. This documentation also refers to examples but to get the examples you need to install Netbeans and access an update tool tied to the glassfish instance installed with Netbeans. When I do this the server won't start, the update tool won't run, and I can't get the examples. Is there an easy way to get these examples (e.g. a simple download)? I've found other examples such as this one, but they are also dependent upon Netbeans.
Is there a simple and complete ejb/servlet example for Glassfish that can be simply downloaded and does not depend upon Netbeans or other IDE?
The obvious example is the Java EE CargoTracker. It was written to show what a "real" application might look like with pure Java EE APIs so should work on both JBoss and GlassFish. You will need Maven installed to build and run it, but there are more complete details in the readme for the project. Note that some of the information is a little out of date (mostly links to java.net which has been sunset in favour of a GitHub site) but the application itself is still a good example of Java EE 7 APIs.
https://github.com/javaee/cargotracker
I found the examples on github here:
https://github.com/javaee/glassfish-samples
To get and build the examples you will need Git and Maven. These examples are small, complete, and concise. The example that was helpful for my particular problem was this example:
glassfish-samples\ws\javaee5\enterprise\servlet-stateless-ear
It demonstrated that I needed to change the structure of my project such that the servlet was in a .war file and not in a .jar file in the lib folder of my project.

Alfresco Development . Working with All in one Archetype

I have created a multi module project in Alfresco using All-in-one Archetype of the Maven Alfresco SDK. I have selected 1.1.1 archetype version. The project directory was build successfully. But in that directory I couldnt find the wcmqs(Alfresco Web Quick Start) directory which is used to build websites. Can anyone help me hw to get this wcmqs, as I need to work with wcmqs for creating new pages and templetes in wcmqs?
The wcmqs module did used to be in the Maven Alfresco SDK but it never worked very well and caused other problems. It is however unnecessary to use the Maven Alfresco SDK if you wish to get started.
To get started with Alfresco Web Quick Start you just need to download and install the files. You can get the files from Sourceforge: http://sourceforge.net/projects/alfresco/files/Alfresco%204.2.f%20Community/
Installation should be straightforward. You need to install the AMPs on your Alfresco instance and deploy the WARs to a servlet container (like your Tomcat).
If you want to customise Web Quick Start, such as changing the model, that is a different matter. There is a short example here that you can go through to give you an idea of what you need to do:
http://ecmarchitect.com/archives/2011/01/06/1254

STS: Losing references in Java Build Path

I am using Spring Source Tool Suite 2.8.1 to implement Spring applications.
I frequently get build errors because references are lost for no apparent reason. In Right-click project in Package Explorer->Properties->Java Build Path->Order and Export, I find projects sometimes are deselected. And often packages are gone in Right-click project in Package Explorer->Properties->Java Build Path->Deployment Assembly.
Having to reset these settings frequently is frustrating. Is there some way I can work around these problems?
I have tried to update STS to the latest version, but the upgrade process fails with incomprehensible error messages. I want to avoid a clean install because setting up the environment again would probably be a nightmare.
Now that I know this is a maven project and you are adding references yourself, this is making sense to me. STS 2.8.x was the last STS to ship with the legacy m2e (maven plugin for Eclipse). It did not recognize build path entries added manually (it likes to have complete control over the classpath). So, what is likely happening is that you are adding these classpath entries and then an update project operation gets kicked off automatically. This will have the effect of removing all of your extra classpath entries.
You are best off doing the following:
Updgrading STS
Or just upgrading your m2e component (you will have to first uninstall the old m2e, but this should be taken care of automatically from the discovery update page).
Or, just accept the fact that you can't manually change your classpath with the legacy m2e.

Release Symfony2 project to the web

I have almost finished the development of a project developed with Symfony2, and wish to put the project online.
However, I suppose there are a lot of things that need to be done so that everything works ok. I suppose, the dev mode needs to be disabled etc....What needs to be done and how?
What are the most important things to do on a Symfony2 project that will be available to everyone on the web?
I suggest you to use Capifony for deployment. It does a lot of stuff out of the box and you can make it run any custom commands you need. See its documentation for details.
Regarding the dev mode, unless you've removed the IP checks from app_dev.php, you don't have to worry about deploying it. Of course, if you wish, you can tell Capifony to delete it on deployment.
The best way to handle deployment is to create "build" script, which will:
Remove all folders and files with tests from your bundles and vendors.
Remove app_dev.php file
Make sure that app/cache and app/logs are fully writable/readable.
Packs your project into archive (rpm f.e.)
Then, before deployment, you should create tag in your project - so it will mean, that certain version of your application is released (I recommend to follow this git branching model).
Create tag.
Run your build script
Upload archive to host
Unpack
Enjoy your project
Im currently researching the same thing.
The first thing you have to consider is "how professional" you want to deploy. There are a lot of tools you can use:
Continous Integration Server ( e.g. Hudson, Jenkins)
Build Tools (e.g. Phing, Capistrano --> Capifony, Shell scripts)
Versioning Tools (e.g. Git, SVN)
I think the simplest setup is using only a Build tool and i guess you are already using some kind of versioning.
Depending on which tool you use, the setup is different, but I think there are some things you should consider with your application (maybe not all are applicable to your application)
Creating a Tag in your Versioning
Copying the new Code in an folder on production
--> if you are in a new folder you dont need to clear the cache and logs, since these shouldnt be in your versioning the first time.
loading composer (if youre using it)
installing vendors
updating database schema
install assets from your bundles
move symlink from current version to the folder of the new site
These are the things I currently need for my application for production deployment, if you deploy to an test environment you should load fixtures and run your testscripts as well.
One other option that is very well described here is to deploy the Symfony2 application with Apache Ant. Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.

Resources