Can't get Rendering Context

When I try to execute my program I got the following errors:
Can’t choose visual,
Can’t get Rendering Context
This happens when my Java program tries to call openGL code written in C++.
This works correctly under WinNT but when I try to do it on a Solaris 2.6 it fails to run.
If anyone has got any tips, pleasse write here.