IBM Liberty server shutsdown after it startsup - eclipse-juno

The Liberty server starts properly and begins to shutdown withing a second.
The server is being started in eclipse version Juno in my Windows development system. The application is a web application with ejb in it. Server configuration details below.
<server description="localWAS">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>localConnector-1.0</feature>
<feature>jndi-1.0</feature>
<feature>wmqJmsClient-1.1</feature>
<feature>jdbc-4.0</feature>
<feature>ejbLite-3.1</feature>
<!-- <feature>jpa-2.0</feature> -->
<feature>json-1.0</feature>
<feature>managedBeans-1.0</feature>
<feature>cdi-1.0</feature>
<feature>servlet-3.0</feature>
</featureManager>
<variable name="[commonlib]" value="/commonlib"/>
<variable name="appLocation" value="[deployment ready app location]" />
<variable name="hostname" value="[host]" />
<httpEndpoint host="${hostname}" httpPort="[httpPort]"
httpsPort="[httpsPort]" id="defaultHttpEndpoint" />
<dataSource id="[oracledb]" jndiName="[oracledb-jndi]">
<jdbcDriver javax.sql.ConnectionPoolDataSource="oracle.jdbc.pool.OracleConnectionPoolDataSource">
<library>
<fileset dir="${[commonlib]}" includes="ojdbc6.jar" />
</library>
</jdbcDriver>
<properties.oracle databaseName="[databaseName]" password="[password]"
portNumber="1521" serverName="[serverName]" user="[user]" />
</dataSource>
more data sources
<variable name="wmqJmsClient.rar.location" value="/servers/IBM/lib/WMQ/ra/wmq.jmsra.rar" />
<jmsQueueConnectionFactory
connectionManagerRef="AIXQCF" jndiName="jms/aixQCF">
<properties.wmqJms channel="SYSTEM.ADMIN.SVRCONN"
hostName="jdawg.pharmacy.com" pollingInterval="5s" port="1416"
queueManager="JDAWG.QAS" rescanInterval="5s" transportType="CLIENT" />
</jmsQueueConnectionFactory>
<connectionManager id="AIXQCF" maxPoolSize="2" />
<jmsQueue id="[jmsQueueId]" jndiName="jms/[jmsQueueName]">
<properties.wmqJms baseQueueName="[baseQueueName]" />
</jmsQueue>
more queues
<jndiEntry id="[jndiEntryId]" jndiName="[jndiEntryName]"
value="[jndiEntryValue]" />
more jndi entries
<logging
traceSpecification="*=info:com.ibm.ws.http.internal.*=all:com.ibm.ws.webcontainer.*=all:com.ibm.ws.http.channel.*=all:Naming=all:NamingService=all:com.ibm.ws.app*=all" />
<applicationMonitor updateTrigger="mbean" />
<application context-root="[application-context-root]" id="[application-id]"
location="${appLocation}" name="[application-name]" type="war" /></server>
I looked at the trace log file located at [..liberty\usr\servers[profile]\logs] and extracted some logs that might be useful.
Here are some classes in logs listed to shorten the lines..
ApplicationStateCoordinator - com.ibm.ws.app.manager.ApplicationStateCoordinator
ApplicationStateMachineImpl - com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl
ApplicationConfigurator - com.ibm.ws.app.manager.internal.ApplicationConfigurator
AppManagerActivator - com.ibm.ws.app.manager.ready.AppManagerActivator
Util - com.ibm.ws.classloading.internal.Util
VirtualHostImpl - com.ibm.ws.http.internal.VirtualHostImpl
DynamicVirtualHostConfiguration - com.ibm.ws.webcontainer.osgi.DynamicVirtualHostConfiguration
logs:
[15:01:59:784] 0000001d id= ApplicationStateCoordinator > updateStartingAppStatus Entry
com.ibm.ws.app.manager_101
STARTED
[15:01:59:784] 0000001d id= ApplicationStateCoordinator < updateStartingAppStatus Exit
[15:01:59:784] 0000001d id=4150c9af internal.ApplicationConfigurator < notifyAppStarted Exit
[15:01:59:784] 0000001d id=6be25de7 ApplicationStateMachineImpl > setInterruptible Entry
[15:01:59:784] 0000001d id=6be25de7 ApplicationStateMachineImpl > executeQueuedActions Entry
[15:01:59:784] 0000001d id= ApplicationStateMachineImpl 1 ASM[0]: [appName]: executeQueuedActions: interruptible=false
[15:01:59:784] 0000001d id=6be25de7 ApplicationStateMachineImpl < executeQueuedActions Exit
false
[15:01:59:784] 0000001d id=6be25de7 ApplicationStateMachineImpl < setInterruptible Exit
[15:01:59:784] 0000001d id=6be25de7 ApplicationStateMachineImpl < enterState Exit
[15:01:59:784] 0000001d id= ApplicationStateMachineImpl 1 ASM[0]: [appName]: run: called enterState STOPPED
[15:01:59:784] 0000001d id=6be25de7 ApplicationStateMachineImpl < run Exit
[15:01:59:784] 00000012 id= ApplicationStateCoordinator < getSlowlyStartingApps Exit
null
[15:01:59:784] 00000012 id=30ba9255 ready.AppManagerActivator < start Exit
[15:01:59:784] 00000012 id=b34dbc66 LogService-242-ready 1 BundleEvent STARTED
Event:org.osgi.framework.BundleEvent[source=ready_1.0.3.cl50220140403-1858 [242]]
[15:01:59:815] 00000018 id= com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0008I: Feature update completed in 37.251 seconds.
[15:01:59:815] 00000018 id= com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[15:02:01:501] 0000002a id=b34dbc66 LogService-242-ready 1 BundleEvent STOPPING
Event:org.osgi.framework.BundleEvent[source=ready_1.0.3.cl50220140403-1858 [242]]
[15:02:01:501] 0000002a id=30ba9255 ready.AppManagerActivator > stop Entry
org.eclipse.osgi.framework.internal.core.BundleContextImpl#a8e8834d
[15:02:01:501] 0000002a id= ApplicationStateCoordinator > getSlowlyStoppingApps Entry
30
SECONDS
[15:02:01:501] 0000002a id=4150c9af internal.ApplicationConfigurator > getStoppingAppPids Entry
[15:02:01:501] 0000002a id=4150c9af internal.ApplicationConfigurator < getStoppingAppPids Exit
[com.ibm.ws.app.manager_101]
[15:02:01:501] 0000002a id=4150c9af internal.ApplicationConfigurator > stopRunningApps Entry
[15:02:01:501] 0000002a id=6be25de7 ApplicationStateMachineImpl > uninstall Entry
<br>
[15:02:01:501] 0000002a id= ApplicationStateMachineImpl 1 ASM[0]: [appName]: createDependency: created AppDep[7]: desc="resolves when the app [appName] finishes stopping, at which point it will be removed", future=com.ibm.ws.threading.internal.NonCancelableResultFuture#cf28eb9
[15:02:01:501] 0000002a id= ApplicationStateMachineImpl 1 ASM[0]: [appName]: created SCA[1] action=REMOVE
[15:02:01:516] 00000021 id= ApplicationStateMachineImpl 1 ASM[0]: [appName]: run: executing SCA[1] action=REMOVE
<br>.
<br>
[15:02:02:387] 00000021 id= Util > ensureNotNull Entry
Parameter 'domain' must not be null
Thread Context
[15:02:02:387] 00000021 id= Util > ensure Entry
Parameter 'domain' must not be null
true
[15:02:02:387] 00000021 id= Util < ensure Exit
[15:02:02:387] 00000021 id= Util < ensureNotNull Exit
Thread Context
[15:02:02:387] 00000021 id= Util > ensureNotNull Entry
Parameter 'id' must not be null
WebModule:[appName]-[appName]-/[appName]
[15:02:02:387] 00000021 id= Util > ensure Entry
Parameter 'id' must not be null
true
[15:02:02:387] 00000021 id= Util < ensure Exit
<br>.
<br>
[15:02:02:450] 00000021 id= VirtualHostImpl A CWWKT0017I: Web application removed (default_host): http://[host]:9080/[appName]/
[15:02:02:450] 00000021 id=a90f2905 DynamicVirtualHostConfiguration 1 Context root removed /[appName]/*

A couple of things to check -- Do you have application code that is calling System.exit? Are you starting the server without using nohup and then exiting the shell?

Related

Liberty Server :It is not valid to call the 'commit' method on a nontransacted session

I'm moving from WAS8 to Liberty. Following is my code:
connection = factory.createConnection();
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
When I run my application it gives error saying:
DetailedIllegalStateException: JMSCC0014: It is not valid to call the 'commit' method on a nontransacted session.
Server.xml
<variable name="wmqJmsClient.rar.location"
value="${server.config.dir}/wmq/wmq.jmsra.rar"/>
<jmsConnectionFactory jndiName="jms/xyz/QCF" >
<properties.wmqJms
transportType="CLIENT"
hostName="host3153.GOT.NET"
port="1414"
channel="CLIENTS.xyz"
queueManager="host141Q"/>
<connectionManager maxPoolSize="10"/>
</jmsConnectionFactory>
<jmsQueue id="jms/queue1" jndiName="jms/xyz/queue/response">
<properties.wmqJms
baseQueueName="host1533A.RESP"
baseQueueManagerName="host141Q" CCSID="1208" expiry="APP" failIfQuiesce="true" persistence="APP" priority="APP" putAsyncAllowed="ENABLED" readAheadAllowed="ENABLED" readAheadClosePolicy="ALL" receiveConversion="QMGR" targetClient="JMS" receiveCCSID="1208" />
</jmsQueue>
<jmsQueue id="jms/queue2" jndiName="jms/xyz/queue/transportAssignment/request">
<properties.wmqJms
baseQueueName="host1533A.RQST"
baseQueueManagerName="host141Q" CCSID="1208" expiry="APP" failIfQuiesce="true" persistence="APP" priority="APP" putAsyncAllowed="ENABLED" readAheadAllowed="ENABLED" readAheadClosePolicy="ALL" receiveConversion="QMGR" targetClient="JMS" receiveCCSID="1208" />
</jmsQueue>

Primefaces 5.2, when menuitem should be evaluated/executed?

I am using JSF 2.2 with Primefaces 5.2 to implement my JSF project. I'm trying put a linkage with menuitem by using outcome to access my backing bean controller in my main.xhtml such as:
<h:form prependId="false" id="headerForm">
......
<p:menubar >
<p:submenu label="#{apps['application.staff.myinfo']}" icon="ui-icon-document">
<p:menuitem value="#{apps['application.staff.myinfo']}" immediate="true" outcome="#{staffControlBean.viewStaff()}" process="#form" update="#all" icon="fa fa-fw fa-leaf"
disabled="#{empty loginControlBean.staffSession.username}"/>
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
</p:menubar>
......
</h:form>
My backing bean as:
#Named(value = "staffControlBean")
#SessionScoped
public class StaffControlBean implements Serializable{
private static final String STAFF_VIEW="/staff/staffView.xhtml";
......
public String viewStaff(){
logger.info("View staff from menuitem clicked.");
if(loginControlBean.getStaffSession().isChangePassword()){
logger.info("password has to be changed before use this services.");
loginControlBean.fireChangePasswordDialog();
return "";
}else {
return STAFF_VIEW;
}
}
......
}
From above snippet you will see, I expect when I click the menuitem from the menubar, backing end controller method viewStaff will be invoked to return a change password dialog or return to my staff view.
But unfortunately, every time when I access (or refresh) main.xhtml without click any menuitem from menubar, the backing bean method was evaluated/executed twice. This is what I found from my server log:
......
####<Nov 10, 2016 2:02:29 PM AEDT> <Info> <com.longz.ozssc.web.staff.StaffControlBean> <macmini16g.tweedheadstorage.com.au> <OzsscWEBServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <bc92beef-9f93-4923-a503-9a9cee37010d-00000071> <1478746949108> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <View staff from menuitem clicked.>
####<Nov 10, 2016 2:02:29 PM AEDT> <Info> <com.longz.ozssc.web.staff.StaffControlBean> <macmini16g.tweedheadstorage.com.au> <OzsscWEBServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <bc92beef-9f93-4923-a503-9a9cee37010d-00000071> <1478746949109> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <View staff from menuitem clicked.>
......
My question is: When the linkage or buttons in the JSF will be evaluated or executed? Why it always been evaluated or executed when the page was loaded or refreshed. How I can avoid it happen?
Any advice are welcome and appreciated.

(kohana) Unittest DbUnit foreign key constraint

I've searched through google/stackoverflow for a solution but failed to find a satisfying solution.
My issue:
[SQLSTATE[42000]: Syntax error or access violation: 1701 Cannot truncate a table referenced in a
foreign key constraint (integration.b_node_leafs, CONSTRAINT fk_node_id
FOREIGN KEY (node_id) REFERENCES integration.b_nodes (id))]
And I can't find anywhere in the docs who to solve this issue neither a order for the XmlDataSet (which I use).
This doesn't work.
public function setUp() {
$conn=$this->getConnection();
$conn->getConnection()->query("set foreign_key_checks=0");
parent::setUp();
$conn->getConnection()->query("set foreign_key_checks=1");
}
Results in mysql.log
Connect root#localhost on integration_db
Query set foreign_key_checks=0
Connect root#localhost on integration_db
Query TRUNCATE `table_name`
Quit
Quit
This is my dataset.xml (As you can see I start from the bottom).
<?xml version="1.0" encoding="UTF-8"?>
<dataset>
<!-- Meta for node -->
<b_meta id="4321" created_by="###NULL###" deleted="0" />
<!-- Meta for leaf -->
<b_meta id="1010" created_by="###NULL###" deleted="0" />
<!-- Meta for post -->
<b_meta id="1050" created_by="###NULL###" deleted="0" />
<!-- meta for comment -->
<b_meta id="7894" created_by="###NULL###" deleted="0" />
<!-- Add comment -->
<b_comments id="5555" meta_id="7894" text="This is a integrationtest" />
<!-- Add Post -->
<b_posts id="4646" meta_id="1050" title="How to integration" seo_title="how-to-integration" text="Explain why to use integrationtests" />
<!-- Link comment to post -->
<b_post_comments post_id="4646" comment_id="5555" />
<!-- Add Leaf -->
<b_leafs id="3535" meta_id="1010" title="App Testing" seo_title="app-testing" />
<!-- Link leaf to post -->
<b_leaf_posts leaf_id="3535" post_id="4646" />
<!-- Add node -->
<b_nodes id="1234" meta_id="4321" type="forum" title="PHP" />
<!-- Link node to leaf -->
<b_node_leafs node_id="1234" leaf_id="3535" />
</dataset>
PS: I run on PHPUnit 3.7.28
My solution was to save the connection for multiple uses instead of creating new connection for each operation.
In your test setUp function add
public function setUp()
{
$conn = $this->getConnection();
$conn->getConnection()->query("set foreign_key_checks=0");
return parent::setUp();
}
In Kohana_Unittest_Database_TestCase
protected $_connection;
public function getConnection()
{
if ($this->_connection !== NULL)
{
return $this->_connection;
}
// Get the unittesting db connection
$config = Kohana::$config->load('database.'.$this->_database_connection);
if(strtolower($config['type']) !== 'pdo')
{
$config['connection']['dsn'] = strtolower($config['type']).':'.
'host='.$config['connection']['hostname'].';'.
'dbname='.$config['connection']['database'];
}
$pdo = new PDO(
$config['connection']['dsn'],
$config['connection']['username'],
$config['connection']['password']
);
$this->_connection = $this->createDefaultDBConnection($pdo, $config['connection']['database']);
return $this->_connection;
}
See my pull request: https://github.com/kohana/unittest/pull/36

File Upload using Selenium Webdriver and ruby with < button type="button">

I am using Selenium WebDriver and Ruby and I need to automate the file upload feature.
I tried with
WAIT.until { driver.find_element(:css,'div.ui-dialog-buttonset').displayed? }
by using this it gives time out error
elem = driver.find_element(:css,'div.ui-dialog-buttonset')
puts "Hi"
js = <<-end
var buttons = document.querySelectorAll('button');
buttons[0].setAttribute('aria-disabled', true);
end
elem = driver.execute_script(js, elem)
puts elem
elem.send_keys("C:\\Users\\seema\\Desktop\\1413.jpg")
Above code is not working and script fails by following error
here is HTML code
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<div class="ui-dialog-buttonset">
<button class="otherButtonClass ui-state-hover ui-state-focus" type="button" role="button" aria-disabled="false">
<button class="otherButtonClass" type="button" role="button" aria-disabled="false" style="display: none;">
<button class="cancelButtonClass" type="button" role="button" aria-disabled="false">
</div>
</div>
here is error stack
,"message":"error - undefined me
thod `send_keys' for nil:NilClass \n [\"tests/upload_branding.rb:38:in `create_publish_pla
yer'\", \"tests/upload_branding.rb:80:in `PublishPlayerTest'\", \"org/jruby/RubyBasicObjec
t.java:1703:in `__send__'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/minitest-4.7.4/lib
/minitest/unit.rb:1258:in `run'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/minitest-rep
orters-0.14.20/lib/minitest/reporters.rb:62:in `run_with_hooks'\", \"c:/jruby-1.7.4/lib/ru
by/gems/shared/gems/scope-0.2.4/lib/scope.rb:105:in `run'\", \"org/jruby/RubyProc.java:255
:in `call'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:153:in `
recursively_run_setup_and_teardown'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/scope-0.
2.4/lib/scope.rb:155:in `recursively_run_setup_and_teardown'\", \"c:/jruby-1.7.4/lib/ruby/
gems/shared/gems/scope-0.2.4/lib/scope.rb:139:in `run_setup_and_teardown'\", \"c:/jruby-1.
7.4/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:105:in `run'\", \"c:/jruby-1.7.4/li
b/ruby/gems/shared/gems/minitest-4.7.4/lib/minitest/unit.rb:933:in `_run_suite'\", \"org/j
ruby/RubyArray.java:2417:in `map'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/minitest-4
.7.4/lib/minitest/unit.rb:926:in `_run_suite'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gem
s/minitest-reporters-0.14.20/lib/minitest/reporter_runner.rb:45:in `_run_suite'\", \"c:/jr
uby-1.7.4/lib/ruby/gems/shared/gems/minitest-4.7.4/lib/minitest/parallel_each.rb:71:in `_r
un_suites'\", \"org/jruby/RubyArray.java:2417:in `map'\", \"c:/jruby-1.7.4/lib/ruby/gems/s
hared/gems/minitest-4.7.4/lib/minitest/parallel_each.rb:70:in `_run_suites'\", \"c:/jruby-
1.7.4/lib/ruby/gems/shared/gems/minitest-reporters-0.14.20/lib/minitest/reporter_runner.rb
:37:in `_run_suites'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/minitest-4.7.4/lib/mini
test/unit.rb:877:in `_run_anything'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/minitest
-4.7.4/lib/minitest/unit.rb:1085:in `run_tests'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/g
ems/minitest-reporters-0.14.20/lib/minitest/reporter_runner.rb:30:in `run_tests'\", \"org/
jruby/RubyBasicObject.java:1703:in `__send__'\", \"org/jruby/RubyKernel.java:2209:in `send
'\", \"c:/jruby-1.7.4/lib/ruby/gems/shared/gems/minitest-4.7.4/lib/minitest/unit.rb:1072:i
n `_run'\", \"org/jruby/RubyArray.java:1617:in `each'\", \"c:/jruby-1.7.4/lib/ruby/gems/sh
ared/gems/minitest-4.7.4/lib/minitest/unit.rb:1071:in `_run'\", \"c:/jruby-1.7.4/lib/ruby/
gems/shared/gems/minitest-4.7.4/lib/minitest/unit.rb:1059:in `run'\", \"tests/upload_brand
ing.rb:87:in `(root)'\"]","result":false}
In IRB i found following errors
irb(main):038:0> Wait.until { $driver.find_element(:css,'div.ui-dialog-buttonse>button')[1].displayed? }
Selenium::WebDriver::Error::TimeOutError: timed out after 80 seconds (Unable to locate element: {"method":"css selector","selector":"div.ui-dialog-buttonse>button"})}
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/wait.rb:57:in `until'
from (irb):38:in `evaluate'
from org/jruby/RubyKernel.java:1093:in `eval'
from org/jruby/RubyKernel.java:1489:in `loop'
from org/jruby/RubyKernel.java:1254:in `catch'
from org/jruby/RubyKernel.java:1254:in `catch'
from C:\jruby-1.7.4\/bin/jirb_swing:53:in `(root)'
also for second command
irb(main):043:0> elem = $driver.find_element(:css,'div.ui-dialog-buttonse>button')[1]
Selenium::WebDriver::Error::NoSuchElementError: Unable to locate element: {"method":"css selector","selector":"div.ui-dialog-buttonse>button"}
from [remote server] file:///C:/Users/seema/AppData/Local/Temp/webdriver-profile20130704-2984-1wifg7r/extensions/fxdriver#googlecode.com/components/driver_component.js:8444:in `FirefoxDriver.prototype.findElementInternal_'
from [remote server] file:///C:/Users/seema/AppData/Local/Temp/webdriver-profile20130704-2984-1wifg7r/extensions/fxdriver#googlecode.com/components/driver_component.js:8453:in `FirefoxDriver.prototype.findElement'
from [remote server] file:///C:/Users/seema/AppData/Local/Temp/webdriver-profile20130704-2984-1wifg7r/extensions/fxdriver#googlecode.com/components/command_processor.js:10456:in `DelayedCommand.prototype.executeInternal_/h'
from [remote server] file:///C:/Users/seema/AppData/Local/Temp/webdriver-profile20130704-2984-1wifg7r/extensions/fxdriver#googlecode.com/components/command_processor.js:10461:in `DelayedCommand.prototype.executeInternal_'
from [remote server] file:///C:/Users/seema/AppData/Local/Temp/webdriver-profile20130704-2984-1wifg7r/extensions/fxdriver#googlecode.com/components/command_processor.js:10401:in `DelayedCommand.prototype.execute/<'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:51:in `assert_ok'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:66:in `request'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:629:in `raw_execute'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:607:in `execute'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:575:in `find_element_by'
from C:/jruby-1.7.4/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/search_context.rb:42:in `find_element'
from (irb):43:in `evaluate'
from C:\jruby-1.7.4\/bin/jirb_swing:53:in `(root)'
Kindly help
First check out the link Selenium::WebDriver::Wait to avoid such time out error.
You can try the below code :
# implicit time out declarations
wait = Selenium::WebDriver::Wait.new(:timeout => 60)
# wait till the required button element being displayed
# Use the link : http://www.w3schools.com/cssref/css_selectors.asp
# for css selectors
wait.until { driver.find_element(:css,'div.ui-dialog-buttonse>button')[1].displayed? }
elem = driver.find_element(:css,'div.ui-dialog-buttonse>button')[1]
elem.sendKeys("C://path/To/File.jpg")
Update
Looking at the link aria-disabled attribute and your part html below, I am seeing aria-disabled is set as false :
<button class="otherButtonClass ui-state-hover ui-state-focus" type="button" role="button" aria-disabled="false">
That desired button element is disabled.
Now see the question : Does WebDriver support file uploads?
You can't interact with the native OS file browser dialog directly, but we do some magic so that if you call WebElement#sendKeys("/path/to/file") on a file upload element, it does the right thing. Make sure you don't WebElement#click() the file upload element, or the browser will probably hang.
Update
#implicit time out declarations
wait = Selenium::WebDriver::Wait.new(:timeout => 60)
#wait till the div element is being displayed
wait.until { driver.find_element(:css,'div.ui-dialog-buttonse').displayed? }
elem = driver.find_element(:css,'div.ui-dialog-buttonse')
js = <<-end
var buttons = document.querySelectorAll('button');
buttons[0].setAttribute('aria-disabled', true);
end
elem = driver.execute_script(js, elem)
elem.sendKeys("C://path//To//File.jpg")

ColdFusion ImagePaste 500 error

I just started getting a 500 error on a site using the cf ImagePaste() function.
<cfscript> ImagePaste(image, watermark, 0, 0); </cfscript>
<cfset ImagePaste(image, watermark, 0, 0) />
I've tried it both ways above
The full source of the function is below - it works fine with the imagepaste commented out.
<cffunction name="watermark" access="public"
description="adds the carproof logo to a jpeg" output="yes" returntype="any">
<cfargument name="path" required="yes" type="string" default="" />
<cfargument name="filename" required="yes" type="string" />
<cfimage source="#path##filename#" name="image">
<cfimage source="#basepath#../Images/carproof-watermark.png"
name="watermark">
<!---cfscript> ImagePaste(image, watermark, 1, 1); </cfscript--->
<cfimage action="write" destination="#path##filename#"
source="#image#" overwrite="yes" />
</cffunction>
Here is the error I get:
500
ROOT CAUSE:
coldfusion.runtime.EventHandlerException: Event handler exception.
at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:251)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:278)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:198)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: java.lang.ExceptionInInitializerError
at coldfusion.image.Image.paste(Image.java:2307)
at coldfusion.runtime.CFPage.ImagePaste(CFPage.java:5877)
at cffile2ecfm1620657721$funcWATERMARK.runFunction(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Assets/CFC/file.cfm:19)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cffile2ecfm1620657721$funcUPLOAD.runFunction(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Assets/CFC/file.cfm:91)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cfimage2dupload2dtest2ecfm664365309.runPage(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Assets/XHTML/image-upload-test.cfm:10)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfindex2ecfm1182266435.runPage(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/index.cfm:27)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfApplication2ecfc1506803272$funcONREQUEST.runFunction(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Application.cfc:130)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:74)
at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:243)
... 27 more
Caused by: java.lang.NullPointerException
at com.sun.media.jai.util.PropertyUtil.getString(PropertyUtil.java:159)
at javax.media.jai.JaiI18N.getString(JaiI18N.java:22)
at javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:357)
at javax.media.jai.JAI.<clinit>(JAI.java:560)
... 63 more
javax.servlet.ServletException: ROOT CAUSE:
coldfusion.runtime.EventHandlerException: Event handler exception.
at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:251)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:278)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:198)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: java.lang.ExceptionInInitializerError
at coldfusion.image.Image.paste(Image.java:2307)
at coldfusion.runtime.CFPage.ImagePaste(CFPage.java:5877)
at cffile2ecfm1620657721$funcWATERMARK.runFunction(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Assets/CFC/file.cfm:19)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cffile2ecfm1620657721$funcUPLOAD.runFunction(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Assets/CFC/file.cfm:91)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cfimage2dupload2dtest2ecfm664365309.runPage(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Assets/XHTML/image-upload-test.cfm:10)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfindex2ecfm1182266435.runPage(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/index.cfm:27)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfApplication2ecfc1506803272$funcONREQUEST.runFunction(/var/www/vhosts/newride.ca/subdomains/admin/httpdocs/Application.cfc:130)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:74)
at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:243)
... 27 more
Caused by: java.lang.NullPointerException
at com.sun.media.jai.util.PropertyUtil.getString(PropertyUtil.java:159)
at javax.media.jai.JaiI18N.getString(JaiI18N.java:22)
at javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:357)
at javax.media.jai.JAI.<clinit>(JAI.java:560)
... 63 more
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
tested other image functions, some
work & some don't:
Many image functions use JAI. So given the message Could not initialize class javax.media.jai.JAI it makes sense those functions would not work either. First I would make sure the class path did not get mucked up (missing jar, too many jars, etc..). That is the most common cause of problems.
But java.lang.NoClassDefFoundError errors are a pain to figure out. Just guesswork, but looking closer it might be initialization problem Caused by: java.lang.ExceptionInInitializerError. I know JAI reads some property files from the jars when starting up. Maybe they are not accessible for some reason (missing, permissions, ..)? I am not running Centos. So that is my best guess for now.
Might be time to offload image manipulation to a 3rd party binary.
Imagemagick, pil, gd etc.
Are you running CF on OS X? (as we do)
The JAI library that ships with OS X's Java is an older version compared to the latest on my Windows machine. Some image editing features, for us, simply dont work on our Mac dev environments, but work perfectly in their Windows equivalents.