SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Compass for ejb3 and jpa application

This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 12 - Pages: 1 - Last Post: Nov 28, 2011 1:01 AM Last Post By: clothworld
nesvarbu

Posts: 1
Registered: 6/22/08
Compass for ejb3 and jpa application
Posted: Jun 22, 2008 1:01 PM
 
  Click to reply to this thread Reply
Hello,

I want to ask how i should configure Compass on simple ejb3 and jpa application. How should i create Compass instance for indexing and searching? I want to index database when application starts. I tried to do it like that:
public class SearchIndexerServiceBean implements SearchIndexerServiceRemote {
 
    @PersistenceUnit(unitName = ServiceConstants.GLOBAL_PERSISTENCE_UNIT)
    private EntityManagerFactory emf;
 
    public void indexEntities() {
        try {
            CompassConfiguration conf = new CompassConfiguration()
                    .setConnection("/tmp/index").addClass(Item.class);
            Compass compass = conf.buildCompass();
            CompassGps gps = new SingleCompassGps(compass);
            CompassGpsDevice jpaDevice = new JpaGpsDevice("jpa", emf);
            gps.addGpsDevice(jpaDevice);
            gps.start();
            gps.index();
        } catch (Exception e) {
            System.err.println(e);
        }
    }
}


This is stateless remote ejb. Now i invoke it from web app, unfortunately i get an exception:
16:43:03,379 ERROR [HibernateJpaIndexEntitiesIndexer] {jpa}: Failed to index the database
javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
        at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:470)
        at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:443)
        at org.compass.gps.device.jpa.DefaultEntityManagerWrapper.beginTransaction(DefaultEntityManagerWrapper.java:32)
        at org.compass.gps.device.jpa.AbstractEntityManagerWrapper.open(AbstractEntityManagerWrapper.java:38)
        at org.compass.gps.device.jpa.indexer.HibernateJpaIndexEntitiesIndexer.performIndex(HibernateJpaIndexEntitiesIndexer.java:102)
        at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:105)
        at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
        at org.compass.core.CompassTemplate.execute(CompassTemplate.java:130)
        at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:151)
        at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:103)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
16:43:03,383 ERROR [STDERR] org.compass.gps.CompassGpsException: Failed to index, execution exception; nested exception is
java.util.concurrent.ExecutionException: org.compass.gps.device.jpa.JpaGpsDeviceException: {jpa}: Failed to index the database; nested exception is
javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call


So i can't test if my searching is OK. I have another stateless remote ejb for that:
public class SearchServiceBean implements SearchServiceRemote {
 
    private static final int SEARCH_RESULTS_PER_PAGE = 5;
 
    @SuppressWarnings("unchecked")
    public List<Item> search(String pattern, int page) {
        CompassConfiguration conf = new CompassConfiguration().setConnection(
                "/tmp/index").addClass(Item.class);
        Compass compass = conf.buildCompass();
 
        CompassSearchHelper searchHelper = new CompassSearchHelper(compass,
                SEARCH_RESULTS_PER_PAGE);
        CompassSearchResults results = searchHelper
                .search(new CompassSearchCommand(pattern, page));
 
        List<Item> itemsFound = new ArrayList<Item>();
        for (CompassHit hit : results.getHits()) {
            itemsFound.add((Item) hit.getData());
        }
 
        return itemsFound;
    }


As you can see i duplicated code for getting compass instance. I don't think this is good idea. Configure it in stateless ejb is not very good idea either. Also how would real time mirroring work in such case? What is good practice for configuring compass in such environment? How to index database when application starts? Maybe i can configure and index in static{} block of ejb? What if i have two searching ejbs in different machines? Why i get that exception? I'm really confused right now :)
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Compass for ejb3 and jpa application
Posted: Jun 23, 2008 4:37 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
The simplest would be to use this: http://www.compass-project.org/docs/2.0.1/reference/html/gps-embeddedhibernate.html. You can use the HibernateJpaHelper to get the embedded Compass instance in such a case.
Coco

Posts: 25
Registered: 11/2/11
Re: Compass for ejb3 and jpa application
Posted: Nov 2, 2011 11:23 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Peridot stems from olivine cabochons for salewhich inturn belongs to the a good number of packed minerals Wholesale Beadson this planet, then again jewel high-quality olivine is without a doubt pretty infrequent. Olivine tiger eye beadswas that comes with the celestial coral beadsbody overhead, on meteorites, at Mars and even on comets. It extraterrestrial abalone shell for saleolivine countries on this planet on pearl jewellerymeteorites once in a while and really now and again bits of jewel high-quality peridot you find secret with the meteorites. This is often exceptionally infrequent though provides a thrilling wisdom inside the foundation belonging to theGemstone Beads galaxy, research workers quote the fact that the peridot put together on meteorites can be a number of huge amounts of years of age. Then again a large number of peridot diamond at present starts on mines on this planet in considerably less Gemstone Beadsgrow old. Peridot is oftentimes located in lava money deposited and coatings in volcanic lung burning ash it will be mined in lot of websites by hand, explosives are frequently utilized for the start system of the procedure ofWholesale Beads exploration. Commonly peridot can be found in inhospitable venues which includes with the reams in Pakistan, that money deposited you find 15, 000 base together inside the West Himalayas. Because is barely nice good enough designed for 3 months belonging to the 365 days the time period it can also be mined is fixed. Money deposited in peridot designed for diamond you find within a number of venues in the country, plus Questions, South america, Japan, Kenya, Unique south america, Saudi Arabic, Pakistan, Norwegian, Tanzania and even Sri Lanka.
jenny

Posts: 271
Registered: 11/13/11
coach outlet store online
Posted: Nov 13, 2011 7:14 PM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
The

coach factory outlet

has been in business for many years. You can log in to find more information about its products and services.
At

louis vuitton sale

,you will find Louis Vuitton Vernis Wallet uses Vernis leather lining instead of classic Monogram canvas, meanwhile creates another classic style with fashion.
Here's your new way to look sophisticated styles. Carry the hot

coach outlet store online

of this summer and be the true trendsetter!
Several days ago, I chose one style of

hermes scarf

from the Swarovski Outlets, which has won good reputation from many customers.
It is a symbol regarding position not to mention nature, Here I would like to launch a excellent bags pertaining to business men, which may be

louis vuitton online

Cupertino M56398.
Almost everyone has identified effectively about this, below, among the best to make sure you will get much more information about

coach outlet

.
lvzeng

Posts: 268
Registered: 11/13/11
louis vuitton
Posted: Nov 13, 2011 7:52 PM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
Owning

louis vuitton bags

of their own has been the dreams of many fad-seeking people for a quite long time.
You need not worry about the quality of the

coach outlet store online

for sale now. The Coach brand is famous for the perfect products.
I am so confused that I don,t even know where to buy the

louis vuitton

Handbags. Because I can prefer to chose the fashionable design, favorable price, top service .

coach outlet store online

with fashion style and top quality succeed. In any occasions they are very suitable and appropriate for its precise and rich design.
They're not chosen, so one of these ideal for you.For more flexibleness a lot more like these, there are lots of discount 'shoulder' variations outlet

louis vuitton bags

.

hermes birkin

is an Austrian success story par excellence. At the end of the 19th century Daniel Swarovski founded a company with the aim to cut crystals automatically.

coach outlet store

vision system is a visual enjoy, is a visual art. The particular design has been integrated function and the element of elegancy, then show you an exquisite and excellent product.
coach8outlet

Posts: 282
Registered: 11/13/11
Re: Compass for ejb3 and jpa application
Posted: Nov 14, 2011 1:33 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply

louis vuitton handbags

enjoy high reputation all over the world. They are designed for hand, elbow and shoulder carry thanks to comfortable flat leather handles.
If you have been to the mall lately and browsed

coach outlet

you may find that a high price tag goes along with just about everything in the mall.
This client-oriented and faith-rooted store aims at providing the best LV goods and services, such as top-class

louis vuitton uk

and free shipping.
Turn your attention to such discount coach sneakers for women from Coach Outlet Store online, you will find something unique and special of such authentic coach for sale at coach factory outlet store online.

louis vuitton outlet

online just like a person who want to show himself in front of other people, because he is confident enough, he can attain the respect of other people.
Bezel-set

hermes birkin bag

are showcased in all their brilliance in the chic and timeless design of this tennis bracelet. Rhodium-plated metal bracelet with foldover clasp.
The

coach outlet store online

are utilized for formal event in company area that will display your excellent taste.Not only does a briefcase make is easier to carry things.
tonnyben

Posts: 270
Registered: 11/14/11
Re: Compass for ejb3 and jpa application
Posted: Nov 14, 2011 2:26 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply

coach factory outlet online

featured with stylish leather bags and signature materials, and carry this bag, it can designate people seem to be captivatingly feminine and good-looking. Why not to buy one when it is at an affordable price?
The products that

louis vuitton outlet

is countless, such as: purses, bags, handbags, shoes, belt. Even the same kind of product includes the products for women, the products for men, for summer-day use, for winter-day use.So, it is probably far beyond your imagination.
As a perfect combination of classic and modern fashion,

coach outlet online

can show the customers'unique personality.

hermes birkin

is your premier online shop for a wide range of quality Swarovski Crystal products such as Swarovski Crystals earring, Jewelry, Bracelet etc.
You could find them in desirable quality and price. If you don't mind high class louis vuitton replica bags, have a good time at

louis vuitton outlet online

.

coach purses

tend to be among finest style strikes associated with these days! They're the standing image that many ladies possess, or even, intend on obtaining.
azsxa

Posts: 158
Registered: 9/27/11
Re: Compass for ejb3 and jpa application
Posted: Nov 14, 2011 3:19 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
Just prior to close up in the ugg boots clearance advertising campaign in the Subsequent Freedom Mortgage loan a lot of areas throughout In ended up less than his uggs for cheap or her quotas and yes it ended up being needed for your finance institutions for you to suppose your unsold area of your respected quotas automatically records. The state of hawaii got received your fame Cheap bailey button uggs Ugg Boots involving firing the 1st picture with the opposing forces, by way of Sergeant Alexander Posture, your "red-haired gunner" via Southerly Bend over.
cainiao1988

Posts: 134
Registered: 11/16/11
Coach Outlet Online
Posted: Nov 19, 2011 2:31 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
louis vuitton

Coach Factory Store Online

monogram vernis

Coach Outlet Online Store

handbags That

Coach Factory Outlet

brings these

Coach Factory Store Online

to aim

Coach Factory Online

to piece of

Coach Outlet Online

junk or

Coach Outlet Online Store

replicate models

Coach Factory Outlet Online

like Louis

Coach Outlet Online

vuitton Galliera

Coach Factory Online

Game master

Coach Factory Outlet

. though the

Coach Factory

This particular

Coach Online Outlet

language plus

Coach Purses Outlet

the Far eastern

Coach Factory Outlet Online

federal government

Coach Outlet Store Online

happen to

Coach Online Outlet

be purposely

Coach Factory

rubber stamping

Coach Online Outlet Store

away the

Louis Vuitton Bags

fact that amount

Coach Outlet Store Online

of entrepreneurialism

Coach Bags

.A phenomenon

Coach Factory

for Japanese adult

Louis Vuitton Outlet

males buying

Louis Vuitton Outlet

the female

Coach Factory Outlet

counterpart Louis

Coach Outlet Store Online

vuitton purses

Coach Purses Outlet

is also illustrative

Coach Online Outlet Store

for the way

Coach Outlet Store Online

in which entwined

Louis Vuitton

national healthcare

Louis Vuitton

along with

Coach Outlet Online

marketing between

Coach Outlet

capitalist along

Coach Outlet Store

with nominally

Coach Factory Store

communist nations

Louis Vuitton Sunglasses

has end

Coach Outlet Store Online

up right now.
clothworld

Posts: 1,130
Registered: 11/16/11
Canada Goose Jacket
Posted: Nov 22, 2011 2:25 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
Simply started out taking pictures the movie Canada Goose Jacket while movie director Steven Spielberg around the staff in the Canada Goose Sale crew declared the particular discipline: not necessarily Canada Goose Parka meeting everyone, additional Canada Goose Youth Parka operate deal discretion conditions must Canada Goose Chilliwack Parka be involved. In a small tropical isle in order to take essential displays, Spielberg and even small block off of the studio, and invited Canada Goose Women Jacket all media editors boarded a small fishing boat, whenever cinematography begins, the particular Canada Goose Canada yacht was having increasingly more of Canada Goose Womens Expedition Parka the correspondents in the studio much. In these security are extremely unpleasant, Canada Goose Expedition Parka a lot of editors have started to understand more about alternate options, they will obtained a little cameras, spend some money to hire nearby residents and individuals across the actors within the facilities or Canada Goose Online captured pics of inside capturing, whenever these works are Canada Goose Coats simply, Sri Lanka Pierre Iceberg yet again pressured self-control, all the extra supplies can be given a $ 80 daily Canada Goose Trillium Parka wage, they should do to accomplish his or her responsibilities in the arrangement, the confidentiality procedures.
clothworld

Posts: 1,130
Registered: 11/16/11
Belstaff Jackets
Posted: Nov 22, 2011 7:19 PM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
The us government has revoked the whole 2008 Belstaff Jackets governmental assistance "Building Sturdy, Safe Belstaff Leather Jackets and sound and also Profitable Online communities", including basic Belstaff Uk Affordable guidance on commission. As well as summary of that fresh Affordable Direction reiterates the Government's Belstaff Bags objective to be able to annul the statutory jobs to ready a Maintainable Group Method as well as Duty Belstaff Womens Jackets to see, Consult & Call for.
For any folks invested in more and better resident contribution, that is a knock back, i believe.
But strangely enough, the newest one-pager Can involve many responsibilities around consultation.
Very first, this Assistance definitely makes the next point:
"To own proper sense of balance–plus in advance Belstaff Coats of coming to a decision how you can complete their full capacity Cost Job– specialists they are under some sort of Accountability to refer to officials Belstaff Mens Blouson of your wide range of neighborhood persons; that isn't optionally available. Government bodies ought to confer with officials with authorities tax payers, those who utilize or maybe are likely to work with services offered by your guru, and those listed towards the power to get an desire for almost any location in how the expert carries Belstaff Mens Jackets out capabilities. Belstaff Sale Government bodies will include neighborhood volunteer and also neighborhood companies plus business owners such assessment. Belstaff Jacket This would implement at all stages of the commissioning period, which include when it comes to the actual decommissioning associated with providers."
This references the particular 2000 County Respond Belstaff Womens Blouson Segment three Part only two, which will states:nterestingly, the revolutionary Best Value Direction subsequently goes on to state firmly with regard to regional consultation primarily with budgetary issues in hard periods.
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: Compass for ejb3 and jpa application
Posted: Nov 26, 2011 3:22 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
The generals, meanwhile,

Coach Outlet

issued an unusual apology for the

Chanel Handbags

deaths of at least 38 people

Coach Outlet

during the week of unrest

Chanel Bags

and the injuries of more than 2,000.

Coach Factory Outlet

But even as they hailed the dead

Coach Outlet Online

as “martyrs,” the generals also appeared

Coach Outlet

to justify killing them as criminals

Coach Outlet

who had attacked the Interior Ministry.

Coach Outlet Online

And they denied — despite the statements

Louis Vuitton Bags

of many witnesses, doctors and

Coach Factory Outlet

even the health ministry — that security

Louis Vuitton Bags

forces had fired live ammunition or birdshot in

Coach Outlet

their clashes with protesters, further inflaming anger.
clothworld

Posts: 1,130
Registered: 11/16/11
Re:Timberland Boots Sale
Posted: Nov 28, 2011 1:01 AM   in response to: nesvarbu in response to: nesvarbu
 
  Click to reply to this thread Reply
Thought that Timberland Boots Sale all matters need Cheap Timberland Boots by oneself primarily, ever not to Timberland UK consider others' Timberland Boots standpoint Special Timberland Boots or the sentiment, arrogant, Mens Timberland Chukka Boots are supercilious. Passes through time lothes not to be able to put on again second time, likes trading the race car frequently. Had been infatuated with the guitar, but by artistic layman's paternal grandmother was ridiculed, no longer Mens Timberland Boat Shoes moves. “later will talk incessantly paternal grandmother not in the words, the majority of properties turned over to me”, by now paternal Mens Timberland Roll-Top Boots grandmother did not know Mens Timberland Custom Boots has brought the emaciated girl from Womens Timberland 6 Inch Boots where, announced that must give the Womens Timberland Boots entire fortune he, this was also insufficient, old woman added that must cut off his all sources of income. In order to recall this absurd condition, but is working with the high graciousness astronomy, discovered All Timberland Boots that oneself likes on this enemy unexpectedly, he New Timberland Boots feels flustered to his Lovers Timberland Boots action. Unexpectedly graciousness star's side had Timberland Beach Sandals the mature perfect man handsome world, but has received Womens Timberland Roll-Top Boots US since the high school Timberland Kids Boots time's good friend to be Mens Timberland Boots also unable to own sentiment to neglect again, finally Women's Timberland Boots Snow finally with graciousness star Mens Timberland 6 Inch Boots in the same place.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums