JBoss 7.2.0 Set poolMaxSize on MDB error - jboss7.x

When I try to set the poolMaxSize attribute on my Message Driven Bean, I encounter this issue
"JBAS014746: pool-max-size may not be null"
I see the same response both when I try to set it via jconsole as well as via mBeanServerConnection.setAttribute code.
Can anyone please guide me on how to set the value for this attribute?
Thanks in Advance!

I believe you are talking about "maxSession" property, which specifies the maximum amount of mdb instances that can process messages.. If that is the case, then you should use maxSession property
#MessageDriven(name = "MessageMDBSample", activationConfig = {
#ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
#ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/sampleQueue"),
#ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10"),
#ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })
In the previous example, it was set to 10 instances

Related

Questions regarding update of table on Prestashop

I'm trying to update ps_stock_available when I modify the product on Prestashop. But it's unsuccessfull. Could you help me please ?
public function hookActionUpdateQuantity(array $params)
{
$id_product = $params['id_product'];
$product = new Product((int)$id_product);
$id_category = $product->id_category_default;
$db = \Db::getInstance();
$request_loc='SELECT location FROM `'._DB_PREFIX_.'category_location` WHERE `id_category` = '.(int)$id_category;
$location = $db->getValue($request_loc);
$request_id_stock='SELECT id_stock_available FROM `'._DB_PREFIX_.'stock_available` WHERE `id_product` = '.(int)$id_product;
$id_stock_available = $db->getValue($request_id_stock);
$result = $db->update('stock_available', array('location' => $location), '`id_stock_available` = '.(int)$id_stock_available);
}
I have written this code but it doesn't seem to work.
in order to accomplish this task I would rely to the native StockAvailable class metehods getStockAvailableIdByProductId() and setLocation() (check the classes/stock/StockAvailable.php file).
Anyway your code seems to be correct, so I would definitely check for undefined variables and/or something not working in the $db->update statement.
In case, you can change it to :
$db->execute('UPDATE '._DB_PREFIX_.'stock_available SET `location` = "'.pSQL($location).'" WHERE id_stock_available = '.(int)$id_stock_available;

How do I properly return as JSON-ified version of Parse object?

I'm hitting a custom function on my server, getting a PFObject in my Convos objects and returning that object from JS, which results in this string in my Objective-C code:
"<convos: 0x6080002ae220, objectId: e1VYAIFCyQ, localId: (null)> {
\n buyerDeleted = NO;\n buyerId = NNfjWZrk8r;\n buyerPicture = \"<PFFile: 0x60800065de80>\";\n buyerSentMessage = YES;\n buyerSentTwoMessages = YES;\n buyerUnseen = 0;\n buyerUser = \"<PFUser: 0x6080002f1900, objectId: NNfjWZrk8r, localId: (null)>\";\n buyerUsername = corby;\n convoId = bQLQWNEtwmNNfjWZrk8r;\n lastSent = \"<messages: 0x60c0000b8600, objectId: iYVIjJ6A3q, localId: (null)>\";\n lastSentDate = \"2018-06-05 19:09:52 +0000\";\n profileConvo = YES;\n sellerDeleted = NO;\n sellerId = bQLQWNEtwm;\n sellerSentMessage = YES;\n sellerUnseen = 0;\n sellerUser = \"<PFUser: 0x6080002f1a80, objectId: bQLQWNEtwm, localId: (null)>\";\n sellerUsername = tough;\n source = profile;\n totalMessages = 3;\n
}"
I'm trying to take the convo object in my JS and run convo.toJSON() on it (which seems like the solution) and then return it but that seems to take an extremely long time.
Any tips on how to return that Parse object so that I can ultimately turn it into an NSDictionary and then a PFObject in the client?
I think we got you covered in slack, but for anyone else who finds this:
Don't use toJSON() from your server, just return the Parse.Object
In your Obj-C code, add this line to the success block of your call back:
PFObject *resultParseObject = (PFObject*)object, where object is the _Nullable id object parameter to the callback of your cloud function.

sending email to multiple accounts using php ews

The below code is used for sending email using jamesiarmes/php-ews
in my application
$request = new \jamesiarmes\PhpEws\Request\CreateItemType();
$request->MessageDisposition = "SendOnly";
$request->SavedItemFolderId->DistinguishedFolderId->Id = "sentitems";
$request->Items->Message->ItemClass = "IPM.Note";
$request->Items->Message->Subject = "exchange new mail";
$request->Items->Message->Body->BodyType = 'HTML';
$request->Items->Message->Body->_ = "This is a test mail as a part of exchange settings set up ";
$request->Items->Message->ToRecipients->Mailbox->EmailAddress = "rejith.rj#pitsolutions.com";
$response = $this->app['ews']->CreateItem($request);
But the problem is I can add only one email address as recipient, how can I add multiple email addresses in ToRecipients?
I checked out the php-ews documentation. You can create an array with multiple recipients this way:
$toAddresses = array();
$toAddresses[0] = new EWSType_EmailAddressType();
$toAddresses[0]->EmailAddress = 'john.harris#domain.com';
$toAddresses[0]->Name = 'John Harris';
$toAddresses[1] = new EWSType_EmailAddressType();
$toAddresses[1]->EmailAddress = 'sara.smith#domain.com';
$toAddresses[1]->Name = 'Sara Smith';
And then add it to your object like this:
$request->Items->Message->ToRecipients = $toAddresses;
Try this and feedback me please.
Seems to me that your problem has not been solve yet?
Following works for me:
$toAddresses = array();
$toAddresses[0]="test#test.com";
$toAddresses[1]="test2#test.com";
$api = MailAPI::withUsernameAndPassword("server", "username", "password");
$message = new Type\MessageType();
$message->setBody('Some Text');
$message->setSubject('Test Subject');
$message->setToRecipients($toAddresses);

Hippo cms add content to repository

This time I'm trying add a values to repository using component. I don't have problem with reading.
Currently, I'm trying add the city to the repository
My code:
Session session = this.getPersistableSession(request);
HippoBean siteBaseBean = request.getRequestContext().getSiteContentBaseBean();
HippoBean hippoFolder = siteBaseBean.getBean("city");
Node node = hippoFolder.getNode();
String path = node.getPath(); // it's working "/content/documents/myhippoproject/city"
node.addNode("4","hippo:handle");
session.save();
after this code nothing happened. I tried also:
node.addNode("4",HippoNodeType.HIPPO_NODE);
No errors and node.
ok, I found a solution.
Session session = this.getPersistableSession(request);
HippoBean siteBaseBean = request.getRequestContext().getSiteContentBaseBean();
HippoBean hippoFolder = siteBaseBean.getBean("city");
Node node = hippoFolder.getNode();
HippoRepository repository = HippoRepositoryFactory.getHippoRepository("vm://");
Session session2 = repository.login("admin", "admin".toCharArray());
HstRequestContext requestContext = request.getRequestContext();
WorkflowPersistenceManager wpm = null;
wpm = getWorkflowPersistenceManager(session2);
wpm.setWorkflowCallbackHandler(new BaseWorkflowCallbackHandler<DocumentWorkflow>() {
public void processWorkflow(DocumentWorkflow wf) throws Exception {
wf.requestPublication();
}
});
String name = "12";
wpm.createAndReturn(node.getPath(), "myhippoproject:City", name, false);
City city = (City) wpm.getObject(node.getPath() + "/" + name);
wpm.update(city);
session2.save();

How to access project name from a query of type portfolioitem

I am trying to match Project name in my query and also trying to print the name of the project associated with each feature record. I know there are plenty of answers but I couldn't find anything that could help me. I am trying to do something like this:
pi_query.type = "portfolioitem"
pi_query.fetch="Name,FormattedID,Owner,c_ScopingTeam,c_AspirationalRelease,c_AssignedProgram,Tags"
#To be configured as per requirement
pi_query.project_scope_up = false
pi_query.project_scope_down = false
pi_query.order = "FormattedID Asc"
pi_query.query_string = "(Project.Name = \"Uni - Serviceability\")"
pi_results = #rally.find(pi_query)
I am trying to match the project name but it simply doesn't work, I also tried printing the name of the project, i tried Project.Name, Project.Values or simply Project. But it doesn't work. I am guessing it is because of my query type which is "portfolioItem" and I can't change my type because I am getting all other attribute values correctly.
Thanks.
Make sure to fetch Project, e.g: feature_query.fetch = "Name,FormattedID,Project"
and this should work:
feature_query.query_string = "(Project.Name = \"My Project\")"
Here is an example where a feature is found by project name.
require 'rally_api'
#Setup custom app information
headers = RallyAPI::CustomHttpHeader.new()
headers.name = "create story in one project, add it to a feature from another project"
headers.vendor = "Nick M RallyLab"
headers.version = "1.0"
# Connection to Rally
config = {:base_url => "https://rally1.rallydev.com/slm"}
config[:username] = "user#co.com"
config[:password] = "secret"
config[:workspace] = "W"
config[:project] = "Product1"
config[:headers] = headers #from RallyAPI::CustomHttpHeader.new()
#rally = RallyAPI::RallyRestJson.new(config)
obj = {}
obj["Name"] = "new story xyz123"
new_s = #rally.create("hierarchicalrequirement", obj)
query = RallyAPI::RallyQuery.new()
query.type = "portfolioitem"
query.fetch = "Name,FormattedID,Project"
query.workspace = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/12352608129" }
query.query_string = "(Project.Name = \"Team Group 1\")"
result = #rally.find(query)
feature = result.first
puts feature
field_updates={"PortfolioItem" => feature}
new_s.update(field_updates)