Commit bd8daf8a authored by Rodrigo Carneiro Henrique's avatar Rodrigo Carneiro Henrique
Browse files

[SCS-343]: Erro ao carregar o XML na demo stockmarket


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/scs/core/java/trunk@120647 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 561cb73a
......@@ -19,6 +19,11 @@
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>resources</directory>
</resource>
</resources>
<plugins>
<plugin>
......
<?xml version="1.0" encoding="iso-8859-1" ?>
<component xmlns="tecgraf.scs.core">
<scs:component xmlns:scs="tecgraf.scs.core">
<id>
<name>StockLogger</name>
<version>1.0.0</version>
......@@ -17,4 +17,4 @@
<facetImpl>scs.demos.stockmarket.servant.FileExchangePrinterImpl</facetImpl>
</facet>
</facets>
</component>
</scs:component>
package scs.demos.stockmarket.server;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.Properties;
import javax.xml.parsers.ParserConfigurationException;
import org.omg.CORBA.ORB;
import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CORBA.TypeCodePackage.BadKind;
......@@ -31,6 +33,7 @@ public class StockLoggerServer {
/**
* @param args
*
* @throws InvalidName
* @throws AdapterInactive
* @throws WrongPolicy
......@@ -43,13 +46,14 @@ public class StockLoggerServer {
* @throws BadKind
* @throws SecurityException
* @throws IllegalArgumentException
* @throws FileNotFoundException
* @throws SCSException
* @throws ParserConfigurationException
*/
public static void main(String[] args) throws InvalidName, AdapterInactive,
ServantNotActive, WrongPolicy, IllegalArgumentException, SecurityException,
BadKind, InstantiationException, IllegalAccessException,
ClassNotFoundException, InvocationTargetException, NoSuchMethodException,
FileNotFoundException {
ServantNotActive, WrongPolicy, BadKind, InstantiationException,
IllegalAccessException, ClassNotFoundException, InvocationTargetException,
NoSuchMethodException, IOException, SCSException,
ParserConfigurationException {
// These properties are used to force JacORB instead of Sun's ORB
// implementation.
......@@ -63,14 +67,15 @@ public class StockLoggerServer {
POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
poa.the_POAManager().activate();
XMLComponentBuilder xmlBuilder = new XMLComponentBuilder(orb, poa);
// "Metadata-only" component creation
// The API will be responsible for creating the servants and registering
// them with the POA.
File is = new File("resources/" + args[0]);
XMLComponentBuilder xmlBuilder = new XMLComponentBuilder();
ComponentContext context;
try {
context = xmlBuilder.build(orb, poa, is);
context = xmlBuilder.build(is);
}
catch (SCSException e) {
e.getCause().printStackTrace();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment