I just had to post this.
When iOS 5 came out a while back (months ago), I had tried to use WiFi syncing. I never succeeded.
For some reason, when my iPhone (4S) was plugged into the wall, and both the iPhone were connected on my only wireless network, the phone would never show up in the iTunes device list. Also, on the iPhone, when I went to Settings / Wifi syncing, the Synchronize button was greyed out.
What was even weirder was that I could see my iPhone's music as a shared library on iTunes on my Mac, AND, I was also using my iPhone Remote app to control iTunes on the Mac remotely.
But, WiFi syncing wasn't working.
I read many troubleshooting threads either on the Apple official forum or elsewhere. Nothing worked, so I left it at that.
Today, I must have spent another 2 hours on the problem, same result.
That is, until I changed one of the variables : the network.
Instead of trying to connect both the Macbook and the iPhone through my wireless router, what I did was to create an Ad-Hoc network on the Macbook, and tried to make WiFi syncing work through that network.
IT WORKED !
If you want to try it :
Apple menu / Preferences / Network, then click on the list-box showing your current WiFi network (right section), and select "Create a network". Name that network "Test Network", and click OK.
Now, on your iPhone, go to the Settings app and select that new network for WiFi.
I may have restarted iTunes, or maybe not, but the iPhone showed up in the Devices section, and the WiFi sync kicked in.
I then reconnected the Macbook and iPhone to my original WiFi network, and the iPhone still showed up in the Devices section.
It's like using that other network cleaned something up in the Macbook's or iPhone's internals or something.
Hope it helps someone.
Sunday, June 24, 2012
Tuesday, May 22, 2012
Java: NoClassDefFoundError for a class inside a jar in your classpath
Here's an obvious one that took me a lot longer to figure out than I wanted.
I have a class (A) that uses another class (B) that sits within a jar.
To launch the class, I used :
java -cp full/path/to/B.jar:./ fully.qualified.name.for.A
I get the NoClassDefFoundError exception for B at the line where I try to instantiate it.
- Made sure the path to B.jar was correct
- Opened up the jar and made sure B was in there, in the correct directory.
Turns out that the jar had been made on Windows with a Manifest classpath in Windows format (C:\etc...) that didn't exist on the Linux machine I was trying the class on.
I rebuilt the jar, making sure the classpath was empty in the manifest, and instead referred to the classes that were in that earlier manifest classpath in the -cp argument.
Problem solved.
I have a class (A) that uses another class (B) that sits within a jar.
To launch the class, I used :
java -cp full/path/to/B.jar:./ fully.qualified.name.for.A
I get the NoClassDefFoundError exception for B at the line where I try to instantiate it.
- Made sure the path to B.jar was correct
- Opened up the jar and made sure B was in there, in the correct directory.
Turns out that the jar had been made on Windows with a Manifest classpath in Windows format (C:\etc...) that didn't exist on the Linux machine I was trying the class on.
I rebuilt the jar, making sure the classpath was empty in the manifest, and instead referred to the classes that were in that earlier manifest classpath in the -cp argument.
Problem solved.
Wednesday, March 28, 2012
Macs, Remote Desktop and keyboards
I have a little project I'm developing in Java on top of my real job.
I usually do my development directly on my Windows machine, but I often connect through Remote Desktop from my Mac.
I have a French keyboard Mac, and the keyboard on the Windows machine is also French.
Of course, when you develop Java programs, the following keys are used extensively: {}[].
The problem is that the key combinations required on the Mac to produce these characters aren't sent correctly to the Windows PC through Remote Desktop. The quickest way to circumvent this problem is simply to copy and paste braces or brackets from existing code. Quite annoying.
I remember having searched for this problem before, and at that time I had not found anything.
Today I did : Ctrl + Alt.
It turns out that, for example, to type a { on my Mac, I have to type Alt-7, but when I'm in Remote Desktop, I need to use Ctrl-Alt-è.
Here are a couple of mappings that are useful :
To get a Type
{ Ctrl-Alt-è
} Ctrl-Alt-à
[ Ctrl-Alt-^
] Ctrl-Alt-ç
I imagine that for other languages, the key combinations would be different, but I'm convinced that you'll find them with Ctrl-Alt :-)
I usually do my development directly on my Windows machine, but I often connect through Remote Desktop from my Mac.
I have a French keyboard Mac, and the keyboard on the Windows machine is also French.
Of course, when you develop Java programs, the following keys are used extensively: {}[].
The problem is that the key combinations required on the Mac to produce these characters aren't sent correctly to the Windows PC through Remote Desktop. The quickest way to circumvent this problem is simply to copy and paste braces or brackets from existing code. Quite annoying.
I remember having searched for this problem before, and at that time I had not found anything.
Today I did : Ctrl + Alt.
It turns out that, for example, to type a { on my Mac, I have to type Alt-7, but when I'm in Remote Desktop, I need to use Ctrl-Alt-è.
Here are a couple of mappings that are useful :
To get a Type
{ Ctrl-Alt-è
} Ctrl-Alt-à
[ Ctrl-Alt-^
] Ctrl-Alt-ç
I imagine that for other languages, the key combinations would be different, but I'm convinced that you'll find them with Ctrl-Alt :-)
Sunday, January 8, 2012
OpenDNS, Dyndns, and DNS cache on Windows
I hope this helps someone in the future.
I've been using Dyndns.org for probably more than 10 years in order to be able to access my servers at home while I'm out of the house. Since most home routers have been supporting Dyndns for many years, this is a really simple setup.
In the last year or two, my kids have grown up and are now at the age where they use the internet on a daily basis, and so I've decided to use OpenDNS for my DNS needs, which has the added bonus of having url filters built in, so that I can minimally control what web sites my kids have access to.
I'm also a developer, and I have a machine set up at my buddy's house to host a web site. Since he has a dynamic IP also, I set up his own Dyndns account so that I can access the site from my home.
What I started experimenting was that when my buddy's ISP changed his IP, I couldn't access the site anymore using the Dyndns name.
As it turns out, OpenDNS' DNS tables are not updated right away when an IP address changes. After a bit of research, I found another service, DNS-O-MATIC, which allows you to tell OpenDNS that your IP has changed. So I set up an account there for my buddy, added dns-o-matic to his ddclient, and it worked fine.
Except for my Windows machines.
When my buddy's IP would change, ddclient on his machine would contact DNS-O-MATIC to request the OpenDNS IP change. At that point, if I was at home on a Linux machine and I tried to ping the Dyndns name, it would return the new address. However, on my Windows 7 machine, I'd still get the old address.
More Google.
It turns out that Windows has a DNS cache running by default. This cache, it seems, gets reset every 24 hours. If you disable that cache, then your system will query OpenDNS everytime you request a URL, but at least you'll get the latest one.
To enable/disable the cache, Start, Run..., and type "services.msc" and Enter. Then look for DNS Client, and disable/enable it.
With DNS cache enabled, you can also flush the current cache by typing the following in a command window : ipconfig /flushdns.
Finally, you can see the list of cached URLs by typing ipconfig /displaydns.
I've been using Dyndns.org for probably more than 10 years in order to be able to access my servers at home while I'm out of the house. Since most home routers have been supporting Dyndns for many years, this is a really simple setup.
In the last year or two, my kids have grown up and are now at the age where they use the internet on a daily basis, and so I've decided to use OpenDNS for my DNS needs, which has the added bonus of having url filters built in, so that I can minimally control what web sites my kids have access to.
I'm also a developer, and I have a machine set up at my buddy's house to host a web site. Since he has a dynamic IP also, I set up his own Dyndns account so that I can access the site from my home.
What I started experimenting was that when my buddy's ISP changed his IP, I couldn't access the site anymore using the Dyndns name.
As it turns out, OpenDNS' DNS tables are not updated right away when an IP address changes. After a bit of research, I found another service, DNS-O-MATIC, which allows you to tell OpenDNS that your IP has changed. So I set up an account there for my buddy, added dns-o-matic to his ddclient, and it worked fine.
Except for my Windows machines.
When my buddy's IP would change, ddclient on his machine would contact DNS-O-MATIC to request the OpenDNS IP change. At that point, if I was at home on a Linux machine and I tried to ping the Dyndns name, it would return the new address. However, on my Windows 7 machine, I'd still get the old address.
More Google.
It turns out that Windows has a DNS cache running by default. This cache, it seems, gets reset every 24 hours. If you disable that cache, then your system will query OpenDNS everytime you request a URL, but at least you'll get the latest one.
To enable/disable the cache, Start, Run..., and type "services.msc" and Enter. Then look for DNS Client, and disable/enable it.
With DNS cache enabled, you can also flush the current cache by typing the following in a command window : ipconfig /flushdns.
Finally, you can see the list of cached URLs by typing ipconfig /displaydns.
Friday, December 9, 2011
Reading a properties file, in an Axis2 web service, from the file system...
For those with some experience with Axis2 web services, you know that the axis2 application gets installed, as all Tomcat applications, in the <TOMCAT_ROOT>/webapps directory.
The axis2 app itself has a WEB-INF sub-directory, which itself contains these :
- classes
- conf
- lib
- modules
- services
I've been coding a few web services lately which use some java libraries (jars). I've found that the easiest way for the web services to get access to those libraries is to install all these jars in the WEB-INF/lib directory.
I then came to this requirement : one of the classes in one of the libraries needed to get its configuration information from a Properties file.
When I was coding within the Eclipse environment, that was easy enough, I just put the configuration file in my Eclipse project's root, and then used the following code :
Nothing new here, and it worked like a charm.
The problems started when I packaged that class into a library, and tried to use it from some web service installed in Axis2. The file couldn't be found anymore, or, more precisely, I had no idea where to put the file.
Note that I didn't want to put the file within the AAR archive : I wanted the file to be outside the web service's archive because I wanted to configure the application from a text file that could be easily changed with a text editor directly on the target server. I wanted to avoid having to rebuild the archive everytime I wanted to install somewhere where I needed different properties.
It turns out that all that's needed is this :
- put your properties file in the WEB-INF/classes directory or your Axis2 installation, or to be more precise, in <TOMCAT_ROOT>/webapps/axis2/WEB-INF/classes
- in your code, use this.getClass().getResourceAsStream(), like this :
Did you notice the "/" in front of the filename on the third line ?
This means look in the root of the classpath. And the root of the classpath, in an Axis2 web service environment, is <TOMCAT_ROOT>/webapps/axis2/WEB-INF/classes.
Hope this helps.
The axis2 app itself has a WEB-INF sub-directory, which itself contains these :
- classes
- conf
- lib
- modules
- services
I've been coding a few web services lately which use some java libraries (jars). I've found that the easiest way for the web services to get access to those libraries is to install all these jars in the WEB-INF/lib directory.
I then came to this requirement : one of the classes in one of the libraries needed to get its configuration information from a Properties file.
When I was coding within the Eclipse environment, that was easy enough, I just put the configuration file in my Eclipse project's root, and then used the following code :
String filename = "config.properties"; Properties props = new Properties(); props.load(new FileInputStream(filename));
Nothing new here, and it worked like a charm.
The problems started when I packaged that class into a library, and tried to use it from some web service installed in Axis2. The file couldn't be found anymore, or, more precisely, I had no idea where to put the file.
Note that I didn't want to put the file within the AAR archive : I wanted the file to be outside the web service's archive because I wanted to configure the application from a text file that could be easily changed with a text editor directly on the target server. I wanted to avoid having to rebuild the archive everytime I wanted to install somewhere where I needed different properties.
It turns out that all that's needed is this :
- put your properties file in the WEB-INF/classes directory or your Axis2 installation, or to be more precise, in <TOMCAT_ROOT>/webapps/axis2/WEB-INF/classes
- in your code, use this.getClass().getResourceAsStream(), like this :
String filename = "config.properties";
Properties props = new Properties();
InputStream isr = this.getClass().getResourceAsStream("/"+filename);
if (isr != null){
InputStreamReader isrProperties = new InputStreamReader(isr);
props.load(isrProperties);
}
Did you notice the "/" in front of the filename on the third line ?
This means look in the root of the classpath. And the root of the classpath, in an Axis2 web service environment, is <TOMCAT_ROOT>/webapps/axis2/WEB-INF/classes.
Hope this helps.
Monday, August 15, 2011
Getting a Canadian iPhone to work with an AT&T GoPhone SIM card, Conclusion
Back from vacation in Virginia Beach, and I thought I'd let all know that the AT&T SIM card I put in my Canadian iPhone 3G has worked flawlessly for the complete duration of my trip.
I had read on different sites that AT&T might deactivate the SIM, supposedly because they could detect that my phone was canadian, but no such thing happened.
So, I definitely recommend using the GoPhone SIM card in the iPhone 3G. As for the iPhone 4, it doesn't work as far as I can tell.
I had read on different sites that AT&T might deactivate the SIM, supposedly because they could detect that my phone was canadian, but no such thing happened.
So, I definitely recommend using the GoPhone SIM card in the iPhone 3G. As for the iPhone 4, it doesn't work as far as I can tell.
Friday, August 5, 2011
Getting a Canadian iPhone to work with an AT&T GoPhone SIM card, Part 5
Well, I'm now on highway 87 driving down to VA beach, and although coverage is spotty at best, I can now confirm that the GoPhone SIM card works in my jailbroken and unlocked iPhone 3G.
Thursday, August 4, 2011
Getting a Canadian iPhone to work with an AT&T GoPhone SIM card, Part 4
Yesterday, I tried to get my old iPhone 3G to work with the GoPhone SIM.
The challenge was to jailbreak the phone, as it's not compatible with jailbreakme.com. After a few trials and errors, I finally succeeded jailbreaking it with redsn0w, although it seems that since I was on iOS 4.2.1, there's now no way to bring it back to "factory settings" as far as the baseband is concerned : I'm stuck with the iPad baseband (6.xx), which is required for the unlocking to work. I of course then unlocked the phone with ultrasn0w.
Had I known that I was going to use my 3G phone instead of my new iPhone 4, I wouldn't have cut the SIM into a MicroSIM. But the damage was done, and so I had to come up with a quick fix for that. I just took an old satellite access card and cut a regular SIM out of it, and then cut the inside of that so that I could fit my GoPhone MicroSIM in it, and voilà, I had my MicroSIM-to-SIM adapter.
I then proceeded to insert them in my iPhone 3G, and the result is encouraging : no "SIM failure" message, just the phone working normally, but showing "Network unavailable" in the top-left.
We'll know tomorrow, when I'm in an AT&T tower range, whether the setup works or not.
The challenge was to jailbreak the phone, as it's not compatible with jailbreakme.com. After a few trials and errors, I finally succeeded jailbreaking it with redsn0w, although it seems that since I was on iOS 4.2.1, there's now no way to bring it back to "factory settings" as far as the baseband is concerned : I'm stuck with the iPad baseband (6.xx), which is required for the unlocking to work. I of course then unlocked the phone with ultrasn0w.
Had I known that I was going to use my 3G phone instead of my new iPhone 4, I wouldn't have cut the SIM into a MicroSIM. But the damage was done, and so I had to come up with a quick fix for that. I just took an old satellite access card and cut a regular SIM out of it, and then cut the inside of that so that I could fit my GoPhone MicroSIM in it, and voilà, I had my MicroSIM-to-SIM adapter.
I then proceeded to insert them in my iPhone 3G, and the result is encouraging : no "SIM failure" message, just the phone working normally, but showing "Network unavailable" in the top-left.
We'll know tomorrow, when I'm in an AT&T tower range, whether the setup works or not.
Wednesday, August 3, 2011
Getting a Canadian iPhone to work with an AT&T GoPhone SIM card, Part 3
Quick update : I drove down to the US border last night to try the GoPhone SIM card in my iPhone 4 within range of an AT&T tower.
Turns out I'm getting the same behavior as I did at home in Montreal : I either get the "SIM failure" message, or if I put the phone in airplane mode and reboot, I then get one network bar and no connection to the AT&T network.
After further research this morning, I have found that the baseband used by my iPhone, 04.10.01, can not be unlocked by ultrasnow. I'm at version 4.3.3 of iOS by the way.
I'm looking right now at other avenues, namely :
- trying to install a custom iOS (with different baseband) onto my phone, I don't know if that's at all possible
- trying the SIM in my old iPhone 3G (I don't remember which iOS version / baseband it was on).
Turns out I'm getting the same behavior as I did at home in Montreal : I either get the "SIM failure" message, or if I put the phone in airplane mode and reboot, I then get one network bar and no connection to the AT&T network.
After further research this morning, I have found that the baseband used by my iPhone, 04.10.01, can not be unlocked by ultrasnow. I'm at version 4.3.3 of iOS by the way.
I'm looking right now at other avenues, namely :
- trying to install a custom iOS (with different baseband) onto my phone, I don't know if that's at all possible
- trying the SIM in my old iPhone 3G (I don't remember which iOS version / baseband it was on).
Sunday, July 24, 2011
Getting a Canadian iPhone to work with an AT&T GoPhone SIM card, Part 2
This was SIM-cutting day !
I took out my Rogers MicroSIM, and laid it next to the GoPhone SIM. Cutting was required on all four sides. There are plenty of Youtube videos that will show you exactly how to do it. I would probably recommend a MicroSIM cutter available on Ebay, but for those that don't have the patience of waiting for shipping, you can basically get it done with scissors.
The name of the game here is : apply yourself. You are better off cutting less than needed at first, and then cutting hair-thin layers until you get the exact cut that is required. I found that aligning both chips along one side of my iPhone was a good way to make sure that my cuts were ok.
Once you're done, put both MicroSIMs on top of each other and make sure they are the same size. My Rogers SIM had its corners a bit rounded off, so I did the same to the GoPhone SIM.
The next step is to change your APN settings on your phone. Open up this post in your iPhone and click on the link. You'll get an easy-to-use iPhone app that lets you choose your provider, and will create a Profile in your General settings.
I made sure my 3G data was off before I inserted the SIM. I'm pretty sure that's useless, as I've read that there's no roaming available in Canada for GoPhone SIMs, but I didn't want to risk it anyway.
Finally, I inserted the AT&T MicroSIM in the tray, put the tray back into the iPhone.
If you are within reach of an AT&T cell tower, I imagine that the AT&T network would show up on the screen. My problem is that I'm doing all this in Montreal, and I'd have to drive to probably 5 km of the border to get some kind of AT&T signal.
My experience so far is that I'm getting a SIM failure popup right after I insert the MicroSIM.
My first conclusion was that either I have a bad SIM, or I cut it wrong. I haven't ruled out the bad SIM, but the bad cutting just doesn't make sense. When you look at the contacts, it's not as if having a contact point that's half a millimeter to either side would have any effect : each contact is at least 2-3 millimeters wide.
I googled a bit on the SIM failure thing. Some people talk about rebooting, others specify putting the phone in airplane mode before rebooting, which is what I did. Once rebooted, I turned off airplane mode, and I didn't get the SIM failure message. Then again, I don't get any network showing up on the screen, and there's only one bar showing.
I guess I'll have to drive down close to the border to really see if I've got a working SIM or not. I'll probably do that within the next 10 days or so.
Stay tuned...
Saturday, July 23, 2011
Getting a Canadian iPhone to work with an AT&T GoPhone SIM card
First I want to mention that this post on Cocoanetics.com was what started it all for me...
There are a few sources of information for this project, and I wanted to share my own experience as of July 2011.
At the moment, I've found only one valid solution to having 3G data available in the US without paying the horrendous roaming data fee that Rogers (or any other carrier) charges : the GoPhone prepaid SIM card from AT&T.
If you're ok with Edge speed, then you could also go with Simple Mobile, which works on the T-Mobile network and thus only provides Edge data.
The first step is to get your hands on a GoPhone SIM card. If you search on Ebay, you'll see that there are SIM cards available from US sellers for anywhere from $5 to $10 shipped. As I was not willing to risk the SIM card not being shipped in time for my departure, I decided to drive down to Plattsburgh NY instead, which is about a 1-hour drive from where I live.
I first tried to get the SIM card at Walmart's, and then Radio-Shack, but they didn't sell the SIM card without an accompanying phone. I then went to the AT&T store on Smithfield road.
As I had read on a couple of sites beforehand, the staff first tried to convince me that the GoPhone SIM card wouldn't work in my iPhone. I told them politely that I looked it up and that I didn't expect them to support me in the process, and they agreed to sell me the SIM and a phone/text plan ($2/day unlimited, minimum purchase $15) as well as a Data plan ($25 for 500MB).
I then rode my car back to the canadian border, told the agent exactly what I had bought, and they let me through.
So I am back home, and later on this weekend I'll proceed with the next step, which will be to cut the SIM into a MicroSIM, then change the APN settings in the iPhone, and finally pop the SIM card in to test it, although I'll be in Canada... we'll see what happens.
Wednesday, January 23, 2008
Jakarta's FTPClient and localhost
I was asked to build a web application that would receive an input file through HTTP Upload, work on the file, and then upload a resulting file on an FTP server.
In order to test the application, I set up an FTP server (filezilla) on my development machine.
Everything was working fine on the dev machine. I then changed my properties file to switch to the production FTP server. At that point, the FTP part didn't work : it seemed that the login credentials were wrong. I checked the credentials with a command prompt FTP session, and it was working fine.
After pulling my hair a little bit, I realized I had a bug in the program on the line where I used FTPClient's connect method : instead of using the FTP host specified in the properties file, I was using NULL. This translated in the program connecting to localhost, which explains why the program worked with an FTP server on my development machine, and not with a remote FTP server.
So, with Jakarta's FTPClient class, a null host means localhost when using the connect method.
In order to test the application, I set up an FTP server (filezilla) on my development machine.
Everything was working fine on the dev machine. I then changed my properties file to switch to the production FTP server. At that point, the FTP part didn't work : it seemed that the login credentials were wrong. I checked the credentials with a command prompt FTP session, and it was working fine.
After pulling my hair a little bit, I realized I had a bug in the program on the line where I used FTPClient's connect method : instead of using the FTP host specified in the properties file, I was using NULL. This translated in the program connecting to localhost, which explains why the program worked with an FTP server on my development machine, and not with a remote FTP server.
So, with Jakarta's FTPClient class, a null host means localhost when using the connect method.
Wednesday, December 19, 2007
Oracle, modPerl, and french accents
Since moving from one Linux server to another, our modPerl application had a hard time saving accented characters from the french language (éàè etc...). The characters were saved in the database as upside-down question marks, or at least that's how my TOAD installation displayed them.
It was determined that in order to overcome this problem, we needed to set the NLS_LANG environment variable to the value 'AMERICAN_AMERICA.WE8ISO8859P1'.
But setting that variable in the Apache user's profile doesn't work, nor does setting it through httpd.conf's PerlSetEnv statement.
We had to set it in a Perl script that is loaded through the PerlRequire statement in httpd.conf (I called that script startup.pl). Not only that, it needed to be set in the BEGIN block of that script :
BEGIN {
$ENV{ORACLE_HOME} = '/u01/app/oracle/product/10.2.0/client_1/';
$ENV{NLS_LANG} = 'AMERICAN_AMERICA.WE8ISO8859P1';
}
This is documented elsewhere on the web, but it doesn't hurt to have it here :-)
Humbly...
It was determined that in order to overcome this problem, we needed to set the NLS_LANG environment variable to the value 'AMERICAN_AMERICA.WE8ISO8859P1'.
But setting that variable in the Apache user's profile doesn't work, nor does setting it through httpd.conf's PerlSetEnv statement.
We had to set it in a Perl script that is loaded through the PerlRequire statement in httpd.conf (I called that script startup.pl). Not only that, it needed to be set in the BEGIN block of that script :
BEGIN {
$ENV{ORACLE_HOME} = '/u01/app/oracle/product/10.2.0/client_1/';
$ENV{NLS_LANG} = 'AMERICAN_AMERICA.WE8ISO8859P1';
}
This is documented elsewhere on the web, but it doesn't hurt to have it here :-)
Humbly...
Tuesday, December 18, 2007
Apache's AddDefaultCharset
Simple problem this morning, we switched servers for one of our Perl applications, and upon running it, we noticed that all accented characters were displayed as weird characters.
The page was coded as ISO-8859-1...
The problem was Apache's AddDefaultCharset which was set to UTF-8. I don't know if the httpd.conf had this setting originally, or if it's our admin that changed it, but sure enough putting it back to ISO-8859-1 fixed our problem.
I know, we'd be better off with UTF-8, but hey, as long as it works...
Humbly...
The page was coded as ISO-8859-1...
The problem was Apache's AddDefaultCharset which was set to UTF-8. I don't know if the httpd.conf had this setting originally, or if it's our admin that changed it, but sure enough putting it back to ISO-8859-1 fixed our problem.
I know, we'd be better off with UTF-8, but hey, as long as it works...
Humbly...
Friday, December 14, 2007
modPerl and Oracle...
Previously, we were using an older version of the Oracle client on a Linux machine.
We're now trying to recreate the server setup on a VMWare virtual machine that is using Oracle 10.2.0. This server has Apache running with modPerl connecting to Oracle.
The error message we were getting at first was "ERROR OCIEnvNlsCreate (check ORACLE_HOME, permissions, NLS settings etc." or something like that.
The first action that we took was to make the apache user a part of the oinstall group. This made the perl scripts work with Oracle, but not under modPerl.
In order to make script work under modPerl, we added a BEGIN {} group at the start of a startup file that was loaded by the httpd.conf file. Here's the instruction :
BEGIN {
$ENV{ORACLE_HOME} = ‘’;
}
That fixed the modPerl problem.
We're now trying to recreate the server setup on a VMWare virtual machine that is using Oracle 10.2.0. This server has Apache running with modPerl connecting to Oracle.
The error message we were getting at first was "ERROR OCIEnvNlsCreate (check ORACLE_HOME, permissions, NLS settings etc." or something like that.
The first action that we took was to make the apache user a part of the oinstall group. This made the perl scripts work with Oracle, but not under modPerl.
In order to make script work under modPerl, we added a BEGIN {} group at the start of a startup file that was loaded by the httpd.conf file. Here's the instruction :
BEGIN {
$ENV{ORACLE_HOME} = ‘
}
That fixed the modPerl problem.
Tomcat and app-name.xml
I'll start with a stupid but frustrating problem I had this morning.
I have a Tomcat server set up on my machine as a development server, and we deploy tested code on a production server.
The application-name.xml file in the META-INF directory gets copied to the conf/catalina/localhost directory when a War file is deployed on a Tomcat server using Tomcat's HTML manager.
This morning, then, I had to change the connector description for an application because we were switching database servers. So, I changed the description in the META-INF directory, repackaged my War file, and deployed on my server. When I tested the application, data was saved to the original database, and not the new one.
For some reason, the xml file in conf/Catalina/localhost was not being replaced with the new one. I deleted it, re-deployed the War, and voilà, the new database was now active...
Stupid, but it made me waste time.
Very humbly,
Bercy
I have a Tomcat server set up on my machine as a development server, and we deploy tested code on a production server.
The application-name.xml file in the META-INF directory gets copied to the conf/catalina/localhost directory when a War file is deployed on a Tomcat server using Tomcat's HTML manager.
This morning, then, I had to change the connector description for an application because we were switching database servers. So, I changed the description in the META-INF directory, repackaged my War file, and deployed on my server. When I tested the application, data was saved to the original database, and not the new one.
For some reason, the xml file in conf/Catalina/localhost was not being replaced with the new one. I deleted it, re-deployed the War, and voilà, the new database was now active...
Stupid, but it made me waste time.
Very humbly,
Bercy
Should have started this years ago...
Hi,
I'm a web developer living in Canada, with roughly 12 years of full-time work experience as of 2007. I also started programming computers for fun when I was about 12 years old in the eighties...
Technologies that I've used include C, C++, Java, Fortran, Perl, modPerl, Tomcat, Apache, Oracle, mySql, Struts, Hibernate, Motif, Eclipse, ASP, IIS, and I'm sure I'm forgetting some. Recently, I've been mostly using Java with Oracle or mySql, and Tomcat / Apache.
My goal here is to very humbly show where I encounter problems when developing software. We all rely on Google to help us out in finding out solutions to our dev problems, and it usually works out not too bad. But, sometimes it's painstakingly hard to find a solution, and this is just my small contribution to the dev world, hoping that it'll help someone someday.
I'm a web developer living in Canada, with roughly 12 years of full-time work experience as of 2007. I also started programming computers for fun when I was about 12 years old in the eighties...
Technologies that I've used include C, C++, Java, Fortran, Perl, modPerl, Tomcat, Apache, Oracle, mySql, Struts, Hibernate, Motif, Eclipse, ASP, IIS, and I'm sure I'm forgetting some. Recently, I've been mostly using Java with Oracle or mySql, and Tomcat / Apache.
My goal here is to very humbly show where I encounter problems when developing software. We all rely on Google to help us out in finding out solutions to our dev problems, and it usually works out not too bad. But, sometimes it's painstakingly hard to find a solution, and this is just my small contribution to the dev world, hoping that it'll help someone someday.
Subscribe to:
Posts (Atom)