jquery.tablesorter.js v2.0.5b stopped working after an upgrade and downgrade - tablesorter

Last night, I updated my tablesorter scripts, including the widgets and starting having severe problems with my site. All the errors/warnings/notices point at the jquery.cookie.js script (both before and after I upgraded it from the Github site. Here is an excerpt from my php-errors.log file:
[16-Sep-2013 07:58:42 America/New_York] PHP Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 80
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP 1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP 2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP 3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:80
[16-Sep-2013 07:58:42 America/New_York] PHP Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 81
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP 1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP 2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP 3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:81
[16-Sep-2013 07:58:42 America/New_York] PHP Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 82
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP 1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP 2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP 3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:82
[16-Sep-2013 07:58:42 America/New_York] PHP Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 83
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP 1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP 2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP 3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:83
[16-Sep-2013 07:58:42 America/New_York] PHP Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 84
[16-Sep-2013 07:58:42 America/New_York] PHP Stack trace:
[16-Sep-2013 07:58:42 America/New_York] PHP 1. {main}() C:\inetpub\jms\index.php:0
[16-Sep-2013 07:58:42 America/New_York] PHP 2. include_once() C:\inetpub\jms\index.php:2
[16-Sep-2013 07:58:42 America/New_York] PHP 3. setcookie(*uninitialized*, *uninitialized*, *uninitialized*) C:\inetpub\jms\header.php:84
The relevant lines from my header.php file:
setcookie('username',$uname,time()+(60*60*24*365)); // renew cookies for another year
setcookie('useremail',$umail,time()+(60*60*24*365));
setcookie('usernum',$unum,time()+(60*60*24*365));
setcookie('userlast',$ulast,time()+(60*60*24*365));
setcookie('userfirst',$ufirst,time()+(60*60*24*365));
And the screen full of errors on my site:
Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\jms\header.php:73) in C:\inetpub\jms\header.php on line 80 Call Stack: 0.0156 140272 1. {main}() C:\inetpub\jms\index.php:0 0.0156 150600 2. include_once('C:\inetpub\jms\header.php') C:\inetpub\jms\index.php:2 0.1248 6136704 3. setcookie(???, ???, ???) C:\inetpub\jms\header.php:80
Why, suddenly, is PHP complaining about headers being sent when all I have before the setcookie lines is my <head> section? Do one of the .js files output anything to the screen? From the latest upgrade, I'm including:
js/tablesorter/css/theme.black-ice.css
js/tablesorter/jquery.tablesorter.min.js
js/tablesorter/jquery.tablesorter.widgets.min.js
js/tablesorter/hquery.widgets-filter-formatter.min.js
So, I said the heck with it and downgraded back to the version I was using before....
Well, I was having too many problems with the new version so I downgraded to my older version 2.0.5b, which was working perfectly. Even after the new "repeatHeaders" widget I put together. Now I have removed the new CSS file(s), and copied my old JS scripts back into my site, making sure not to leave any trace of the newer version. All of a sudden, my OLD version isn't sorting anymore!!! The headers change just fine but nothing in the actual tables sort. What's going on here???? Here's what the Console says. Please, I need help quickly, this is a PRODUCTION server with a mission critical app!

Related

Error occurred running Grails CLI: Unknown Host (504)

I got an error Unknown Host (504) when I tried to start grails 3.3.2, and the details shows below:
$ grails --stacktrace --verbose
| Error Error occurred running Grails CLI: Unknown Host (504)
org.apache.http.client.HttpResponseException: Unknown Host (504)
at org.eclipse.aether.transport.http.HttpTransporter.handleStatus(HttpTransporter.java:466)
at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:291)
at org.eclipse.aether.transport.http.HttpTransporter.implPeek(HttpTransporter.java:231)
at org.eclipse.aether.spi.connector.transport.AbstractTransporter.peek(AbstractTransporter.java:43)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PeekTaskRunner.runTask(BasicRepositoryConnector.java:376)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:341)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:319)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:301)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:293)
at org.grails.cli.boot.GrailsDependencyVersions.<init>(GrailsDependencyVersions.groovy:53)
at org.grails.cli.boot.GrailsDependencyVersions.<init>(GrailsDependencyVersions.groovy:49)
at org.grails.cli.profile.repository.MavenProfileRepository.<init>(MavenProfileRepository.groovy:53)
at org.grails.cli.GrailsCli.createMavenProfileRepository(GrailsCli.groovy:334)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:235)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Error occurred running Grails CLI: Unknown Host (504)
Here is my version info:
$ grails -v
| Grails Version: 3.3.2
| Groovy Version: 2.4.13
| JVM Version: 1.8.0_121
Extra info: I am running it on Mac behind a proxy network. I've added the following statement into my bin/grails (/Users/foouser/.sdkman/candidates/grails/current/bin/grails) script:
export GRAILS_OPTS="-Dhttp.proxyHost=myHttpProxy -Dhttp.proxyPort=8000 -Dhttps.proxyHost=myHttpsProxy -Dhttps.proxyPort=443"
After few trials and errors, I found this org.eclipse.aether.internal.impl.DefaultRepositorySystem is actually trying to read and parse my $HOME/.m2/settings.xml. And below it was my original settings.xml:
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>myHttpProxy</host>
<port>8000</port>
</proxy>
<proxy>
<id>httpsproxy</id>
<active>true</active>
<protocol>https</protocol>
<host>myHttpProxy</host>
<port>443</port>
</proxy>
</proxies>
<servers>
<server>
<username>myname</username>
<password>mypassword</password>
<id>Artifactory</id>
</server>
</servers>
<mirrors>
<mirror>
<id>Artifactory</id>
<!-- Drive all repositories through the Artifactory mirror -->
<mirrorOf>*</mirrorOf>
<url>http://myartifactoryurl</url>
</mirror>
</mirrors>
</settings>
Unfortunately, it wasn't parsed well...
The current workaround (a bad one though) I have is to change this settings.xml to the default one from maven, which has nothing setup there.

apache 2.4 - Cant get Sybase database connection using mod_lua, mod_dbd, freetds

We are migrating our python scripts to lua scripts as part of apache 2.4 upgrade. One of the requirement is connecting to Sybase database and execute queries.
To do that we have developed a small code using mod_lua api to get db connection, but we haven't been successful.
We have installed the apr-util with freetds.
To get the database connection using mod_lua, mod_dbd and freetds - we followed the steps mentioned here -
http://modlua.org/api/database#dbd
To configure the DPDParams for freetds, we followed the params mentioned here
https://httpd.apache.org/docs/2.4/mod/mod_dbd.html#DBDParams
In VirtualHost of httpd.conf, we have added the following dbdparams
DBDriver freetds
DBDParams username=xxx,password=xxx,host=host-ip:port
DBDMax 10
and the lua code, just for getting a database connection is
require "apache2"
require "string"
function handle(r)
r.content_type = "text/html"
local database, err = r:dbacquire("mod_dbd")
r:err("inside handle method_1 " .. err)
return apache2.OK
end
The error we are getting in apache error log is-
[Thu Aug 25 15:28:03.198044 2016] [dbd:error] [pid 21708:tid
139621318366976] (20014)Internal error (specific information not
available): AH00629: Can't connect to freetds:
[Thu Aug 25 15:28:03.198145 2016] [dbd:error] [pid 21708:tid
139621318366976] (20014)Internal error (specific information not
available): AH00633: failed to initialise
[Thu Aug 25 15:28:03.198184 2016] [lua:error] [pid 21708:tid
139621318366976] [client 10.135.15.148:52836] inside handle method_1
Could not acquire connection from mod_dbd. If your database is
running, this may indicate a permission problem.
​We are able to connect to the database using tsql from the same system, but connection from apache dbd, is not working.
We are suspecting that there might be some configuration(DBDParams) problems or that the OS may be blocking connection from apache
Could someone please help in this regard.
We found the solution. The problem was there in the DBDParams we were passing. For connecting to sybase, we were providing the connection details(host:port) in the 'host' param(host=). On futher looking into the apr-util-freetds code, we found that for Sybase connection it is the **server(server=) param where we should provide the host port connection details**.
http://www.freetds.org/reference/a00371.html#gaef0e7a5fcf2d8c8f795b2b06ce4de8b1
The DBD Params which worked for Sybase connection using freetds is -
DBDParams username=xxx,password=xxxxxx,server=h.o.s.t:port
Its a bit confusing because in sybase terms host is normally the server hostname/ip.

Mongo::Error::NoServerAvailable when running Rails app

When running rails s and connecting to localhost:3000, I get the following error messages when attempting simple queries such as #users.each:
Mongo::Error::NoServerAvailable in Users#index
No server is available matching preference: #<Mongo::ServerSelector::Primary:0x62403672 tag_sets=[] server_selection_timeout=30 local_threshold=0.015>
The console shows
MONGODB | Adding localhost:3000 to the cluster
MONGODB | IOERROR
config/mongoid.yml
development:
clients:
default:
database: virtu_development
hosts:
- localhost:3000
options:
options:
test:
clients:
default:
database: virtu_test
hosts:
- localhost:3000
options:
read:
mode: :primary
max_pool_size: 1
Edit: When running with mongoid.yml set to run on localhost:27017, as is apparently appropriate, the console repeatedly reads out:
No connection could be made because the target machine actively refused it. - connect(2) for 127.0.0.1:27017
Edit 2: Running mongo.exe while in C:\Program Files\MongoDB\Server\3.2\bin yields:
MongoDB shell version: 3.2.4
connecting to: test
2016-03-31T19:14:03.597-0400 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:10061 No connection could be made because the target machine actively refused it.
2016-03-31T19:14:03.597-0400 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:224:14
#(connect):1:6
Running mongod.exe yields:
2016-03-31T19:13:00.636-0400 I CONTROL [initandlisten] MongoDB starting : pid=5564 port=27017 dbpath=C:\data\db\ 64-bit host=Kalyn-PC
2016-03-31T19:13:00.640-0400 I CONTROL [initandlisten] targetMinOS: Windows Vista/Windows Server 2008
2016-03-31T19:13:00.640-0400 I CONTROL [initandlisten] db version v3.2.4
2016-03-31T19:13:00.640-0400 I CONTROL [initandlisten] git version: e2ee9ffcf9f5a94fad76802e28cc978718bb7a30
2016-03-31T19:13:00.640-0400 I CONTROL [initandlisten] allocator: tcmalloc
2016-03-31T19:13:00.640-0400 I CONTROL [initandlisten] modules: none
2016-03-31T19:13:00.640-0400 I CONTROL [initandlisten] build environment:
2016-03-31T19:13:00.641-0400 I CONTROL [initandlisten] distarch: x86_64
2016-03-31T19:13:00.641-0400 I CONTROL [initandlisten] target_arch: x86_64
2016-03-31T19:13:00.641-0400 I CONTROL [initandlisten] options: {}
2016-03-31T19:13:00.642-0400 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory C:\data\db\ not found., terminating
2016-03-31T19:13:00.642-0400 I CONTROL [initandlisten] dbexit: rc: 100
I had to manually
change config/mongoid.yml to run at localhost:27017
create the empty directories C:data/db
then run mongod (in my specific case, navigate to C:\Program Files\MongoDB\Server\3.2\bin and run mongod.exe).
After that, starting up the rails server worked like a charm.
you are trying to connect to mongodb on rails port, the correct host is localhost:27017 , for local server (off course if the db runs locally)
I had observed a similar issue:
MONGODB | Errno::ECONNREFUSED: Connection refused - connect(2) for 127.0.0.1:27017
Rendered gdd_apis/index.html.erb within layouts/application (60062.0ms)
Completed 500 Internal Server Error in 60075ms
ActionView::Template::Error (No server is available matching preference: #<Mongo::ServerSelector::Primary:0x27416600 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015):
19: </tr>
20: </thead>
21: <tbody>
22: <% if #gdd_apis.size == 0 %>
23: <tr>
24: <pis/tr>
25: <% else %>
app/views/gdd_apis/index.html.erb:22:in `_app_views_gdd_apis_index_html_erb___3636122846566909968_28792560'
- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2018-08-31 14:04:39 -0500 ===
- Goodbye!
I found after some searching on the internet that if the machine has IPv6 enabled, then Rails/mongoid tries to connect to mongodb via IPv6, and this was failing.
I was able to get it working by changing the hosts: entry in mongoid.yml from
localhost:27017
to
(machine_ipv4_address):27017

SQLSRV query fail with fatal error 'Maximum function nesting level of '256' reached, aborting!'

I have multiple database connections in config/database.php:
'connections' => [
'mysql' => [
'driver' => 'mysql',
'read' => [
'host' => env('DB_READ_HOST', 'localhost'),
],
'write' => [
'host' => env('DB_WRITE_HOST', 'localhost'),
],
'database' => env('DB_DATABASE', ''),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'mytest',
'username' => '',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
],
]
I use Query Builder to qyery data from sqlserver:
DB::connection('sqlsrv')->table($this->table)
->where('FDate', date('Ymd'))
->take(1)
->get();
and will get the Fatal error:
PHP Fatal error: Maximum function nesting level of '256' reached, aborting! in Unknown on line 0
PHP Stack trace:
PHP 1. {main}() /Users/..../fork/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /Users/..../fork/artisan:36
PHP 3. Symfony\Component\Console\Application->run() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107
PHP 4. Symfony\Component\Console\Application->doRun() /Users/..../fork/vendor/symfony/console/Application.php:120
PHP 5. Symfony\Component\Console\Application->doRunCommand() /Users/..../fork/vendor/symfony/console/Application.php:189
PHP 6. Illuminate\Console\Command->run() /Users/..../fork/vendor/symfony/console/Application.php:838
PHP 7. Symfony\Component\Console\Command\Command->run() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Console/Command.php:136
PHP 8. Illuminate\Console\Command->execute() /Users/..../fork/vendor/symfony/console/Command/Command.php:256
PHP 9. Illuminate\Container\Container->call() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Console/Command.php:150
PHP 10. call_user_func_array:{/Users/..../fork/vendor/laravel/framework/src/Illuminate/Container/Container.php:503}() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Container/Container.php:503
PHP 11. App\Console\Commands\SyncTWSE5MinutesChartSource->handle() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Container/Container.php:503
PHP 12. App\Models\SqlSrv\QTSE012->demo() /Users/..../fork/app/Console/Commands/SyncTWSE5MinutesChartSource.php:19
PHP 13. Illuminate\Database\Query\Builder->get() /Users/..../fork/app/Models/SqlSrv/QTSE012.php:15
PHP 14. Illuminate\Database\Query\Builder->runSelect() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1383
PHP 15. Illuminate\Database\Query\Builder->toSql() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1406
PHP 16. Illuminate\Database\Query\Grammars\SqlServerGrammar->compileSelect() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1315
PHP 17. Illuminate\Database\Query\Grammars\Grammar->compileComponents() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php:32
PHP 18. Illuminate\Database\Query\Grammars\SqlServerGrammar->compileFrom() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php:62
PHP 19. Illuminate\Database\Query\Grammars\Grammar->compileFrom() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php:78
PHP 20. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php:120
PHP 21. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 22. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 23. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 24. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 25. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 26. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 27. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 28. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 29. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 30. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 31. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 32. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 33. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 34. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 35. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 36. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 37. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 38. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 39. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 40. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 41. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 42. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 43. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 44. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 45. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 46. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 47. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 48. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 49. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 50. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 51. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 52. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 53. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 54. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 55. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 56. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 57. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 58. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 59. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 60. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
PHP 61. Illuminate\Database\Grammar->wrap() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39
PHP 62. Illuminate\Database\Grammar->wrapTable() /Users/..../fork/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:77
I change the xdebug setting like following:
[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.max_nesting_level = 1000
but it still got the same error.
This is happening in Laravel 5.1.25 (LTS).
My PHP version is following:
PHP 5.6.16 (cli) (built: Nov 28 2015 22:22:08)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
I would check what the table name is being used in $this->table. Does it have an alias? Does it include the database name with a period then the table name?
In Illuminate\Database\Grammar:
https://github.com/laravel/framework/blob/5.1/src/Illuminate/Database/Grammar.php#L77
wrapTable() calls wrap(), and wrap() can call wrapTable().
Dependant on the table name, it may be getting itself into a massive recursive loop

Java EE 6 embedded glassfish embedded derby EJB unit test

questing is about javaee6 with embedded glassfish and embedded derby jndi lookup for data source at the time of deployment before unit test is executed....
Please find the persistence.xml here...
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="mymodulePU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/__default</jta-data-source>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:derby:C:/myappDB;create=true" />
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode"
value="database" />
<property name="eclipselink.logging.level" value="ALL" />
<property name="eclipselink.logging.file" value="./target/eclipselink.logs" />
</properties>
</persistence-unit>
</persistence>
Please find the server console log here when the unit test is executed....
Jan 24, 2011 5:12:44 PM com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator createResource
WARNING: poolmgr.create_resource_error
Jan 24, 2011 5:12:44 PM com.sun.enterprise.connectors.ConnectionManagerImpl internalGetConnection
WARNING: poolmgr.get_connection_failure
Jan 24, 2011 5:12:44 PM com.sun.gjc.spi.base.DataSource getConnection
WARNING: jdbc.exc_get_conn
Jan 24, 2011 5:12:44 PM org.eclipse.persistence.session.file:/C:/DD/WORKSPACES/lean-soa-arch/entities/target/classes/_mymodulePU.ejb
SEVERE:
Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
Error Code: 0
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:309)
......
.......
......
Caused by: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:112)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:126)
... 44 more
Jan 24, 2011 5:12:44 PM org.eclipse.persistence.session.file:/C:/DD/WORKSPACES/lean-soa-arch/entities/target/classes/_mymodulePU.properties
FINEST: End deploying Persistence Unit mymodulePU; session file:/C:/DD/WORKSPACES/lean-soa-arch/entities/target/classes/_mymodulePU; state Deployed; factoryCount 1
#Bryan He's not trying to run Derby in network server mode, he wants to run it in embedded mode so I don't think your suggestion will help in that case.
The problem he is seeing is because he has a JTA datasource called jdbc/_default defined in his persistence.xml. When embedded glassfish sees this it tries to look it up in its JNDI context and when it does it finds the jdbc/_default resource which is defined in the domain.xml it is using. This by default is a network based Derby resource as defined in the domain.xml.
What Digambar needs to do is to start GF and create a new connection pool which uses embedded derby and create a new jdbc resource which uses that pool for the domain.
I used the glassfish web admin console but you can also use the asadmin command if you know all the command line switches for the various parameters. Either way your domain.xml will then have the new resources. Once you do that simply change your persistence.xml so that the jta-datasource references this new jdbc resource and you should be all set. You can also remove the two javax.persistence properties from your persistence.xml because they are not needed at this point (those settings set when you configure the new connection pool resource).
Make sure to set ;create=true to the ConnectionAttributes property when you configure your embedded connection pool.
After creating the connection pool and jdbc resources my domain.xml had the following. Yours may look slightly different based on the settings you need for your specific application.
<jdbc-connection-pool connection-validation-method="auto-commit" validation-table-name="SYS.SYSALIASES" allow-non-component-callers="true" connection-leak-reclaim="true" lazy-connection-association="true" connection-creation-retry-attempts="90" lazy-connection-enlistment="true" validate-atmost-once-period-in-seconds="120" driver-classname="" datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource40" res-type="javax.sql.DataSource" connection-leak-timeout-in-seconds="60" description="" name="GFEmbeddedPool" is-connection-validation-required="true">
<property name="DatabaseName" value="C:\tmp\db\unit-test"></property>
<property name="ConnectionAttributes" value=";create=true"></property>
<property name="AttributesAsPassword" value="false"></property>
<property name="LoginTimeout" value="0"></property>
</jdbc-connection-pool>
<jdbc-resource pool-name="GFEmbeddedPool" description="" jndi-name="jdbc/__embeddedGF"></jdbc-resource>
The message "java.net.ConnectException : Error connecting to server localhost on port 1527" means that the Derby network server is not up and running. You need to start the Derby network server in order to connect to it. Here's how to start the server: http://db.apache.org/derby/docs/10.6/adminguide/tadmincbdjhhfd.html

Resources