damian cosmos

Ranch Hand
+ Follow
since Dec 13, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by damian cosmos

Hi Hari,
Thanks for the post.
I figured it out a different way as follows using
<xsd:complexType mixed="true">:
<xsd:element name="stream" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="service" minOccurs="0">
<xsd:complexType mixed="true">
<xsd:sequence/>
<xsd:attribute name="sid" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="onid" type="xsd:string" use="required"/>
<xsd:attribute name="tsid" type="xsd:string" use="required"/>
<xsd:attribute name="streamname" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
I reckon you're way is more correct.
Thanks for all your help.
Regards,
Damian.
Hi all,
I have a piece of xml for which I am trying to create the xsd equivalent:
<stream onid='01' tsid='90' streamname='ASTRA1'>
<service sid='7f3'>bbc</service>
<service sid='722'>tg4</service>
<service sid='233'/>
</stream>
The onid and tsid attributes are required but the streamname attribute is optional.
The service tag can occur zero or an unbounded number of times.
The sid attribute is required.
I have come up with the following piece of xsd to define the schema for the xml above:
<xsd:element name="stream" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="service" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="sid" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="onid" type="xsd:string" use="required"/>
<xsd:attribute name="tsid" type="xsd:string" use="required"/>
<xsd:attribute name="streamname" type="xsd:string"/>
</xsd:complexType>
</xsd:element>

The schema works for
<stream onid='01' tsid='90' streamname='ASTRA1'>
<service sid='7f3'></service>
<service sid='722'></service>
<service sid='233'/>
</stream>
but not for
<stream onid='01' tsid='90' streamname='ASTRA1'>
<service sid='7f3'>bbc</service>
<service sid='722'>tg4</service>
<service sid='233'/>
</stream>
Any help would be greatly appreciated.
Regards,
Damian.
Thanks Jim,
You help is much appreciated. I will let you know how I get on.
Regards,
Damian.
20 years ago
Hi all,
I am trying to write an application which will perform trigonometric calculations in a two dimensional coordinate system.
I do not need to render these triangles on a graphics device.
I am talking of coordinate values with a range of 2 to the power of a million.
Are these ranges too big for a java program to process?
Would there be unrealistic timimng constraints on the calculations?
Any help or insights would be greatly appreciated.
Regards,
Damian.
20 years ago
Hi Maulin,
Thanks for your reply.
My situation is that I have a FileChooser where I choose the path of a particular class file name. So I was hoping there was some mechanism to find the package from an not fully qualified class name.
I know that I could access the path as well as the filename of the class I choose from the FileChoser. I could then find the package name from the path
if I knew the start of the package.
This seems an ackward way to complete the task so I was wondering if there was a better solution.
Regards,
Damian.
20 years ago
Hi,
If you have a string that contains a class name (not fully qualified, i.e. Test instead of com.company.Test) can you retrieve the package name ?
I have tried:
String = "test";
Class test = Class.forName(string);
Package package = test.getPackage();
System.out.println(package.getName());
This causes a NoClassDefFoundError.
If String was "com.company.Test"
The output would be:
com.company
Any help would be appreciated.
Regards,
Damian.
20 years ago
Hi,
Does Javamail support SMTP for mail receiving i.e.
using the SMTP TURN and ETRN commands.
Any help would be greatly appreciated.
Regards,
Damian.
21 years ago
Hi all,
I recently had a topic submitted to this forum (Sept 17th, 2002 Subject: ClassCastException problem).
The following is an extract:
I have a bean called Body which is in a package
com.test.config.model.bean. It consists of three
private strings and their getter and setter methods.
I also have a class called Container which is in a package com.test.server.
This class has a getBodyContainer method which returns a vector of Bodys.
I also have a servlet called Test which is in a package
called com.test.config.controller.servlet
Test instantiates a Container object and calls the getBodyContainer method. i.e.
Vector bodys = container.getBodyContainer();
for (int i = 0; i < bodys.size(); i++)
{
Object object = bodys.elementAt(i);
Body body = (Body) object;
}
I get a class cast exception on the line:
Body body = (Body) object;
Why does this happen ?
I have now fixed the problem but I am still confused.
I had both client and server classes in my classpath.
I am using Jakarta Tomcat 4.0 as my servlet engine.
All of the classes mentioned above are on the server side except for the body class whose class file was on the client side.
When I moved it from the client to the server side the ClassCastException dissappeared.
Why does this movement resolve my problem ?
Is there a subtle difference between client and server side objects in how they are accessed ?
Any help would be greatly appreciated.
Regards,
Damian.
21 years ago
Hi all,
I have an unusual question. Is it possible to call an EJB directly from a wml(wireless markup language) file ?
wml files can access URLs so I know it would be possible to call a servlet which could instantiate an EJB.
Is this the only way to do it ?
If not, what are the other ways and which is the best ?
Thanks for your time.
Regards,
Damian.
Hi,
I have tried object.getClass().getName() and it returns Body class.
But instanceof returns false !!
Regards,
Damian.
21 years ago
Hi all,
I have a bean called Body which is in a package
com.test.config.model.bean. It consists of three
private strings and their getter and setter methods.
I also have a class called Container which is in a package com.test.server.
This class has a getBodyContainer method which returns a vector of Bodys.
I also have a servlet called Test which is in a package
called com.test.config.controller.servlet
Test instantiates a Container object and calls the getBodyContainer method. i.e.
Vector bodys = container.getBodyContainer();
for (int i = 0; i < bodys.size(); i++)
{
Object object = bodys.elementAt(i);
Body body = (Body) object;
}
I get a class cast exception on the line:
Body body = (Body) object;
Why does this happen ?
Regards,
Damian.
public Vector getBodyContainer()
{
21 years ago
Hi,
I have a web application which esentially consists of a group of applets embedded in JSP pages which call servlets.
I was thinking of providing an api into the servlets using EJB.
Does this defeat the purpose of EJBs as they can be called on distributed servers but the servlets will sit on a specific web server which the EJBs are dependent on.
21 years ago
Hi,
I'm new to EJBs. Is it possible to call an EJB from a java 1.1.8 applet ?