A A A i

mercredi 26 juillet 2006mercredi 26 juillet 2006

Oracle XE in a vserver

Following the previous entry, I somewhat managed to have a working Oracle XE in a Debian vserver.

Once Oracle XE has been installed, and /etc/init.d/oracle-xe configure executed, I had some problems connecting the database, namely: ORA-12528: TNS:listener: all appropriate instances are blocking new connections. In my case, I did:

chown oracle:dba /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs
/etc/init.d/oracle-xe stop
su oracle
export PATH=$PATH:$ORACLE_HOME/bin
createdb.sh

This destroys the database created with /etc/init.d/oracle-xe configure, and creates a new one, with oracle as the password for the SYS and SYSTEM users. After exiting to root, and starting Oracle, now the management application listens correctly on the vserver IP address, and I can connect to the database with sqlplus. Meanwhile, the email for the confirmation of registration for the Oracle XE forum is still not arrived.(Cyberpunk, 2006/07/26 05:24) lien permanent

Oracle XE hard path to support

I'm currently trying to install Oracle XE on a vserver running Debian. Following this document, the process is pretty smooth... until the start with a wonderful ORA-00600: internal error code, arguments: [keltnfy-ldmInit], [46], [1], [], [], [], [], [] . This is the Oracle way to tell you that it can't resolve your hostname. By default, the vserver has been built without an /etc/hosts file, after creating it and filling it with the rigt IP/host, the server accepts to start (except the administration part, which listens by default only on 127.0.0.1, which is not possible inside a vserver), but opening a connexion is refused.

Google finding nothing, I decide to go to the official forums... Forbidden. Logging in to OTN, still forbidden. In fact, the registration is separate from OTN, even if when you subscribe it creates automatically an OTN registration. So, how to register? Easy, just open KDE or Gnome, or launch the administration application and clic on the link. Of course, this vserver instance has no X, and as we've seen before, the administration application is not running. Grep being my friend, I finally can find the registration link for the Oracle XE forum. No, Google didn't give it right away... nevertheless, Google gives less and less things right away nowadays, maybe because of their pagerank problem. Well, clicking on the link in Firefox, it leads to a wonderful... HTTP error 500 page. Registration temporary broken? The same link works well in Exploder: yes, the web browser has an effect on the server behaviour. Next step, we are redirected on https://profile.oracle.com, which is, for a mysterious reason, inaccessible from China, maybe a Cisco plot. Let's fire a proxy...

The loading of that last URL in Exploder with the proxy is stalled; copying and pasting it in Firefox... works. Life is full of surprises. The page loads correctly my OTN profile, and after disactivating all the newsletters, it's time for me to wait for the confirmation email.(Cyberpunk, 2006/07/26 04:10) lien permanent


mardi 11 juillet 2006mardi 11 juillet 2006

Still no support for User Libraries in Eclipse WST

Eclipse provides a great way to manage sets of jar, it is called User Libraries. This way you can organize groups of jar files, and keep a high-level view of your dependencies. Unfortunately, the standard Eclipse plug-in for J2EE, WST, doesn't care at all about User Libraries, in fact, it doesn't even care about projects' exported entries when you declare a project as a J2EE module dependency. WST, for toys projects only? It's one of the areas where Netbeans is far better than Eclipse. Unfortunately, Netbeans is still behind on several key points, one of them being responsiveness.(Cyberpunk, 2006/07/11 03:06) lien permanent


lundi  3 juillet 2006lundi 3 juillet 2006

Charset detection routine in PHP with Snoopy

Sometimes you can't leave everything being done automatically, like for instance the charset detection when you retrieve something from the web. With HTML and XML, those can be overidden inside the file, and this can be tricky (especially since you must give the correct encoding to the XML parser before giving to it the file). So, here is what I basically use in Radio.Blog to PLS. The depencies are Snoopy the HTTP client library, and a HTML Parser written by Jose Solorzano (unfortunately we don't have TagSoup in PHP). It's crude, but works... here we go:

function url_get_contents($url) {
  $snoopy = new Snoopy;

  $c_data = read_cache($url);

  // [...]
  
  if($snoopy->fetch($url)) {
    $c_data['status'] = $snoopy->status;
    $c_data['charset_embedded'] = false;
    if($snoopy->status == 200) {
      $c_data['charset'] = 'iso-8859-1';
      foreach($snoopy->headers as $header) {
	@list($key,$val) = preg_split('/[: ]+/', $header, 2);
	$val = trim($val);
	$key = strtolower($key);
	switch($key) {
	// [...]
	  case 'content-type':
	  $parts = preg_split('/[ ;=]+/', $key, 3);
	  $c_data['type'] = $parts[0];
	  if(isset($parts[1])) {
	    $c_data[$parts[1]] = $parts[2];
	  }
	  break;
	}
      }
      
      $c_data['content'] = $snoopy->results;
      $charset_found = false;

      // is is raw XML? don't trust the Content-Type header
      $off = strpos($c_data['content'], 'status != 304) {
      if($snoopy->status >= 400 && $snoopy->status < 500) {
	$c_data['error'] = true;
      } else if($snoopy->status >= 500 && $snoopy->status < 600) {
	$c_data['error'] = true;
      }
      // other error... what can we do?
    }
  } else {
    // dooh
  }
  
  return $c_data;
}

function charsetFromHTML(&$c_data) {
  // is it really HTML? We don't even know...
  $subdoc = stristr($c_data['content'], '');
    if($off2 === false) {
      $off2 = strpos($subdoc, '');
    }
    if($off2 !== false) {
      $parser = new HtmlParser(substr($subdoc, 0, $off2 + 7));
	    
      while ($parser->parse()) {
	if($parser->iNodeType == NODE_TYPE_ELEMENT && strtolower($parser->iNodeName) == 'meta') {
	  if(isset($parser->iNodeAttributes['http-equiv'])) {
	    if(!strcasecmp($parser->iNodeAttributes['http-equiv'], 'content-type')) {
	      $parts = preg_split('/[ ;=]+/', $parser->iNodeAttributes['content'], 3);
	      $c_data['type'] = $parts[0];
	      if(isset($parts[1])) {
		$c_data[$parts[1]] = $parts[2];
	      }
	      break;
	    }
	  }
	} else if($parser->iNodeType == NODE_TYPE_ELEMENT && strtolower($parser->iNodeName) == 'body') {
	  break;
	} else if($parser->iNodeType == NODE_TYPE_ENDELEMENT && strtolower($parser->iNodeName) == 'head') {
	  break;
	}
      }
    }
  }
}

(Cyberpunk, 2006/07/03 22:07) lien permanent


qui est

nom : Damien Bonvillain
courriel : kame à cinemasie.com
bloggercode:
B9 D+ T+ K S F I- O X+ E- L- C-- Y1 R+ W- P+ M5 N-- N+
un peu plus : Google Whoring tortue

Messagerie instantanée

    les koms

    m'enfin

    Quant à mes invectives imaginaires, je vous laisse chercher un endroit adéquat pour les ranger. Elles craignent la lumière, si vous voulez une piste.
    Lien associé
    Eolas - « Aimez moi, c'est un ordre. »

    les bons vieux


    archives

    « juillet 2006 »
    lunmarmerjeuvensamdim
    12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31

    XML RSS 2.0 XML RSS 2.0 commentaires A A A i

    liens

    allégeance

    Blog sans chat

    colophon

    Propulsé par pointClairMerci à la caféineDevelopment with EmacsBadges from GTMcKnightFreeListed on BlogSharesGeoURL