2010年06月18日
Couldn't load class (MyApp) because: Couldn't instantiate component "MyApp::Model::CDBI"
はまった。。。。。
Couldn't load class (MyApp) because: Couldn't instantiate component "MyApp::Model::CDBI", "test has no primary key at /usr/lib/perl5/site_perl/5.8.8/Class/DBI/Loader/Generic.pm line 166"Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 114, line 855.
at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 120
Class::MOP::__ANON__('Couldn\'t instantiate component "FormTest::Model::CDBI", "tes...') called at /usr/lib/perl5/site_perl/5.8.8/Try/Tiny.pm line 98
Try::Tiny::try('CODE(0x9d1e4cc)', 'Try::Tiny::Catch=REF(0xa4c5d18)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 125
Class::MOP::load_first_existing_class('FormTest') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 137
Class::MOP::load_class('FormTest') called at /usr/lib/perl5/site_perl/5.8.8/Catalyst/ScriptRole.pm line 61
Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/Catalyst/Script/Server.pm line 181
Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm line 48
Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm line 89
Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/Catalyst/ScriptRunner.pm line 20
Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'FormTest', 'Server') called at script/formtest_server.pl line 8
■解決方法
テスト用だったので、test DBを使っていて、その中にtest テーブルがあるという感じだった。
で、test テーブルにprimary key が設定されていないためにエラーを吐いていた。
こんな感じ
mysql> use test;
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| test |
+----------------+
mysql> desc test;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| aaa | varchar(10) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
mysql> alter table test add primary key (aaa);
で解決。
Couldn't load class (MyApp) because: Couldn't instantiate component "MyApp::Model::CDBI", "test has no primary key at /usr/lib/perl5/site_perl/5.8.8/Class/DBI/Loader/Generic.pm line 166"Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 114, line 855.
at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 120
Class::MOP::__ANON__('Couldn\'t instantiate component "FormTest::Model::CDBI", "tes...') called at /usr/lib/perl5/site_perl/5.8.8/Try/Tiny.pm line 98
Try::Tiny::try('CODE(0x9d1e4cc)', 'Try::Tiny::Catch=REF(0xa4c5d18)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 125
Class::MOP::load_first_existing_class('FormTest') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP.pm line 137
Class::MOP::load_class('FormTest') called at /usr/lib/perl5/site_perl/5.8.8/Catalyst/ScriptRole.pm line 61
Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/Catalyst/Script/Server.pm line 181
Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm line 48
Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Method/Wrapped.pm line 89
Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa4ea718)') called at /usr/lib/perl5/site_perl/5.8.8/Catalyst/ScriptRunner.pm line 20
Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'FormTest', 'Server') called at script/formtest_server.pl line 8
■解決方法
テスト用だったので、test DBを使っていて、その中にtest テーブルがあるという感じだった。
で、test テーブルにprimary key が設定されていないためにエラーを吐いていた。
こんな感じ
mysql> use test;
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| test |
+----------------+
mysql> desc test;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| aaa | varchar(10) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
mysql> alter table test add primary key (aaa);
で解決。
2010年06月15日
入籍しました
先月(5/15)なんですけどね
書くタイミングを逃したので、一カ月遅れの報告です
書くタイミングを逃したので、一カ月遅れの報告です
2010年06月10日
failed: Lost connection to MySQL server at 'reading initial communication pa cket', system error: 104
繋げていたのに、突然エラーを吐いて接続不可。。。。。
ロードバランサーが悪いという結論になった!!
そうに違いない!!
ロードバランサーが悪いという結論になった!!
そうに違いない!!
2010年05月25日
Unrecognized character \xED
rpmでインストールしようとしたら、怒られた
yum localinstall hogehoge.rpm
で解決
yum localinstall hogehoge.rpm
で解決
2010年05月24日
国ごとのIPアドレス帯
2010年05月20日
windows7 へ xpからskypeのデータ移行
備忘録
ファイル名を指定して実行から
%APPDATA%\Skype
を叩くと行ける
ファイル名を指定して実行から
%APPDATA%\Skype
を叩くと行ける
screenの設定
備忘録
$ cat .screenrc
bind 'U' eval "encoding utf8" "stuff 'export LANG=ja_JP.UTF-8\012'"
bind 'E' eval "encoding euc" "stuff 'export LANG=ja_JP.EUC-JP\012'"
bind 'J' eval "encoding shift-jis" "stuff 'export LANG=ja_JP.SJIS\012'"
ctrl + a E で、EUC-JP切り替えなど
$ cat .screenrc
bind 'U' eval "encoding utf8" "stuff 'export LANG=ja_JP.UTF-8\012'"
bind 'E' eval "encoding euc" "stuff 'export LANG=ja_JP.EUC-JP\012'"
bind 'J' eval "encoding shift-jis" "stuff 'export LANG=ja_JP.SJIS\012'"
ctrl + a E で、EUC-JP切り替えなど
2010年05月17日
CentOSで帯域制限
ポート毎に帯域制限を行いたかったので調べてみた
こことか、ここを参考にしてみた。
まずは
1.iproute
2.tc
が必要だそうだが、入っているので
3.cbq.init
のインストールを行った。
▼cbq.initのインストール
インストールと言っても、source forgeから起動スクリプトをダウンロードするだけ
ここから、入手
# cp -ip cbq.init-v0.7.3 /etc/init.d/cbq.init
# chmod +x /etc/init.d/cbq.init
▼cbqのconf格納場所を作成
/etc/sysconfig/cbq と決まっているそうです。
自分の場合は、既に存在していました。
# cd /etc/sysconfig
# mkdir cbq
# cd cbq
▼cbqのconfを書く
・cbq-100.http: WWWサーバへの過大なアクセスにより回線を使い切るのを制限する例。
DEVICE=eth1,1000Mbit,100Mbit
RATE=10Kbit
WEIGHT=1Kbit
PRIO=5
RULE=192.168.11.250:80,
大事なのは、RULEの一番最後のカンマです。
▼起動
/etc/init.d/cbq.init start
▼確認
# tc -s class ls dev eth1
class cbq 1: root rate 1024Mbit (bounded,isolated) prio no-transmit
Sent 812 bytes 6 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 7 undertime 0
class cbq 1:100 parent 1: leaf 100: rate 100000bit (bounded) prio 5
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 2.27043e+06 undertime 0
class tbf 100:1 parent 100:
▼トラブルシューティング
上手くいかない場合は
DEVICE eth1 ---> DEVICE eth0
とか、自分の環境に合わせましょう。
あと、
find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
こんなエラーが出たときは、/etc/init.d/cbq.init を書き換えたら上手くいった。
けど、元に戻しても上手くいくようになった。
謎。。。
# diff cbq.init.old cbq.init
578,579c578,579
< CLASSLIST=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
< -not -name '*~' -maxdepth 1 -printf "%f\n"| sort`
---
> CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
> -not -name '*~' -printf "%f\n"| sort`
584,585c584,585
< DEVFIELDS=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
< -not -name '*~' -maxdepth 1| xargs sed -n 's/#.*//; \
---
> DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
> -not -name '*~' | xargs sed -n 's/#.*//; \
こことか、ここを参考にしてみた。
まずは
1.iproute
2.tc
が必要だそうだが、入っているので
3.cbq.init
のインストールを行った。
▼cbq.initのインストール
インストールと言っても、source forgeから起動スクリプトをダウンロードするだけ
ここから、入手
# cp -ip cbq.init-v0.7.3 /etc/init.d/cbq.init
# chmod +x /etc/init.d/cbq.init
▼cbqのconf格納場所を作成
/etc/sysconfig/cbq と決まっているそうです。
自分の場合は、既に存在していました。
# cd /etc/sysconfig
# mkdir cbq
# cd cbq
▼cbqのconfを書く
・cbq-100.http: WWWサーバへの過大なアクセスにより回線を使い切るのを制限する例。
DEVICE=eth1,1000Mbit,100Mbit
RATE=10Kbit
WEIGHT=1Kbit
PRIO=5
RULE=192.168.11.250:80,
大事なのは、RULEの一番最後のカンマです。
▼起動
/etc/init.d/cbq.init start
▼確認
# tc -s class ls dev eth1
class cbq 1: root rate 1024Mbit (bounded,isolated) prio no-transmit
Sent 812 bytes 6 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 7 undertime 0
class cbq 1:100 parent 1: leaf 100: rate 100000bit (bounded) prio 5
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
borrowed 0 overactions 0 avgidle 2.27043e+06 undertime 0
class tbf 100:1 parent 100:
▼トラブルシューティング
上手くいかない場合は
DEVICE eth1 ---> DEVICE eth0
とか、自分の環境に合わせましょう。
あと、
find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
こんなエラーが出たときは、/etc/init.d/cbq.init を書き換えたら上手くいった。
けど、元に戻しても上手くいくようになった。
謎。。。
# diff cbq.init.old cbq.init
578,579c578,579
< CLASSLIST=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
< -not -name '*~' -maxdepth 1 -printf "%f\n"| sort`
---
> CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
> -not -name '*~' -printf "%f\n"| sort`
584,585c584,585
< DEVFIELDS=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
< -not -name '*~' -maxdepth 1| xargs sed -n 's/#.*//; \
---
> DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
> -not -name '*~' | xargs sed -n 's/#.*//; \
2010年05月13日
事件発生?
朝、友人から突然電話が掛かってきた
この時間帯にお互い電話をすることが無いので、何か重大な事件でも発生かと思って出てみた
しかしこちらが話し掛けても向こうからの反応が全く無い
しばらくすると赤ちゃんぽい声が・・・・
子供が操作したのか
朝からちょっと和んだ
この時間帯にお互い電話をすることが無いので、何か重大な事件でも発生かと思って出てみた
しかしこちらが話し掛けても向こうからの反応が全く無い
しばらくすると赤ちゃんぽい声が・・・・
子供が操作したのか
朝からちょっと和んだ
2010年04月13日
新大久保の発車ベル
山手線を利用して約四年
いつも疑問に思っていた事があった
何故、新大久保は発車ベルがシンプルなベル音なのだろうか
高田馬場なら鉄腕アトム
恵比寿は、エビスビールのテーマ曲
鶯谷は、ウグイスの鳴き声
辺りは有名だと思う
駒込がさくらさくらなのも謎だけど、とにかくメロディーとかが流れる
なのに何故か新大久保はシンプルな「プルルルルルルルル」というもの
ずっと気になっていた
で、ツイッターで山手線の中の人を発見
http://twitter.com/YAMANOTE_LINE
早速聞いてみた
Q「新大久保は何故発車音がベルなんですか?」
A 「特に意味はありません」
ずっと疑問で、JR東日本に問い合わせようかずっと悩んでいた回答がこれか〜
色々と理由を考えていたのに、理由が無いって・・・・・
でも実は公表出来ない真実があるんじゃないかと思ったりしてしまう
なので別ルートでまた尋ねてみよう
いつも疑問に思っていた事があった
何故、新大久保は発車ベルがシンプルなベル音なのだろうか
高田馬場なら鉄腕アトム
恵比寿は、エビスビールのテーマ曲
鶯谷は、ウグイスの鳴き声
辺りは有名だと思う
駒込がさくらさくらなのも謎だけど、とにかくメロディーとかが流れる
なのに何故か新大久保はシンプルな「プルルルルルルルル」というもの
ずっと気になっていた
で、ツイッターで山手線の中の人を発見
http://twitter.com/YAMANOTE_LINE
早速聞いてみた
Q「新大久保は何故発車音がベルなんですか?」
A 「特に意味はありません」
ずっと疑問で、JR東日本に問い合わせようかずっと悩んでいた回答がこれか〜
色々と理由を考えていたのに、理由が無いって・・・・・
でも実は公表出来ない真実があるんじゃないかと思ったりしてしまう
なので別ルートでまた尋ねてみよう
