Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 12-28-2009, 05:04 AM
krishnafru krishnafru is offline
Junior Member
 
Join Date: Dec 2009
Location: Bangalore
Posts: 1
Unhappy Problem using Java Exceptions in PHP

I am using PHP for presentation and Java for Business Logic.

My code is working fine. But when i throw exceptions from Business Logic its giving problem.

Here is the code segment:

Java Code
Code:
package com.vm.php;
public class Database
{
	public String addProfile(Profile profile) throws NullException, InvalidDataException
	{
		if(null == profile)
			throw new NullException();
		
		if(null == profile.getFirstName())
			throw new InvalidDataException();
		
		return "success";
	}
}
PHP Code
Code:
<?php
        import com.vm.php.Database;
	import com.vm.php.exceptions.NullException;
	import com.vm.php.exceptions.InvalidDataException;
	
	echo "<pre>";
	echo "working";
	
	$database = new Java("Database");
	try {
		print_r($database->addProfile(null));
	} catch(NullException $ex) {
		echo "<br />";
		echo 'NullException: ',  $ex->getMessage(), "\n";
	} catch(InvalidDataException $ex) {
		echo "<br />";
		echo 'InvalidDataException: ',  $ex->getMessage(), "\n";
	}
	echo "</pre>";
?>
It is possible to catch exceptions using Quercus?

Thanks in advance.....

Raghu Krishna Kuchi
Reply With Quote
  #2  
Old 12-29-2009, 03:03 AM
ferg ferg is offline
Administrator
 
Join Date: Aug 2009
Posts: 190
Default exceptions

Hmm. You certainly catch all exceptions with catch (Exception $e), but currently the Exception type matching might be based on PHP exceptions, not Java Exceptions.
Reply With Quote
Reply

Tags
exception, java, php, quercus

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:44 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.