Problem using public Wi-Fi
For the past two weeks, I have been trying to access the free Wi-Fi at Bryant Park in Manhattan. The way they have it set up is that you connect and it directs you to a user agreement, which you have to accept to use the network. I think I've only gotten that option once in Mac OS, and I accepted.
I originally boot up normally in Mac OS and the signal fluctuates. Within 5 or so minutes, I lose my ability to connect to sites. Most of the time Airport shows me as being connected but Safari and Firefox tell me I have no connection. My widgets and iChat also don't connect.
When I log into Windows, I have similar problems, except it more often gives me the agree/disagree site. The signal still fluctuates, and after a few minutes, the my connection stops working altogether.
In both cases, there is no WEP key, etc. I fluctuate in both, but it says I'm connected the whole time, even after while my browsers tell me I'm not.
FYI, I am able to wirelessly connect to the router in my home, which is encrypted. Although I haven't tested or used it extensively, it seems to work as expected.
Anyone have an idea what's going on? I'd really appreciate the help.
Thanks.
It may be down to signal strength or possible the wireless network standard being used.
I found my iBook doesn't work well with 802.11b, yet 802.11g networks (secure or not) are perfect. All the current MacBook's have the same network card type, they are compliant with 802.11a, b and g. If we the Mac community are suffering I can only imagine that its non compliance on the networking gear from various manufacturers.
Linksys, D-Link and Cisco seem to be compliant at the moment, not had any experiance with other manufacturers equipment. This may well be the issue, if the signal is weak and your connecting via A or B mode.
Another reason for possible random drop outs is the channel the wireless device is on. This makes a big difference as a noisey channel makes it very hard to decrypt any security and or other information being sent over the channel.
This can be moved via a router setting, you will quickly find a spectrum that is free of noise to help with connectivity!
Similar Messages
-
Could not find used public part
Hi all,
I created a new product in the composite designer with a few Visual Composer Interfaces.
Because our context model changed, I deleted the existing UI, and created a new VC UI (generated from a Process model)
When I want to build everything, I get the exception:
ERROR: Check for used DCs failed: Could not find used public part "40dbb712586011df82d500059a3c7800" of test.com/product/ui/vc (PRODUCT_SC) : Used public part not available (Used public part not available)
Build failed with errors.
Apparantly the guid from the old VC UI was not completly removed.
I found that GUID back in files:
.dcdef
PublicPartFileList.xml
and changed those to the new guid.
But still having the same problem...
Can I change this in another simple way?
regards,
HansHi Hans,
could you switch to the Development Infrastructure perspective and open the view called Component Properties for the VC DC? Most likely the generated public part is still present. I guess you can simply delete it as the corresponding component has been deleted as well.
This public part should be present for the DC of type "Visual Composer Composition Unit Interface".
Which version of the NWDS are you using? I think what I´m describing is actually only a workaround, but would think that the pulblic part deletion should have happened automatically.
Best regards,
Stefan -
Problem using standard libraries in C++ class
Hi
I am new to JNI. I am having problems using standard C++ library.
My java code looks like
public class JavaSide {
public native void sayHello();
static {
System.loadLibrary("NativeSideImpl");
public static void main(String[] args) {
JavaSide app = new JavaSide();
app.sayHello();
and My NativeSideImpl.cpp code is
#include <stdio.h>
#include "JavaSide.h"
JNIEXPORT void JNICALL Java_JavaSide_sayHello
(JNIEnv *env, jobject obj)
cout<<" Hello";
I am compiling this on solaris 5.8 using the following command
CC -G -Kpic -I/usr/java/include -I/usr/java/include/solaris NativeSideImpl.cpp -o libNativeSideImpl.so
when I run my java program using
java JavaSide
I get the following exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/oracle/temp/libhello.so: ld.so.1: java: fatal: relocation error: file /home/oracle/temp/libhello.so: symbol __1cDstdEcout_: referenced symbol not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at HelloWorld.<clinit>(HelloWorld.java:6)
The program works if I replace cout with printf() .
My LD_LIBRARY_PATH does include the path where of the C++ standard libraries.
Any help would be much appreciated
Thanks in advance..Well, cout was just a a simple example. I was having problems with using the std C++ libraries, e.g ostringstream . and likes .
I tried using the -lCstd in the compile option and it worked. -
Problems using java.xml.xpath - How to get values from DTMNodeList?
Sorry for the waffle in the subject title, but I was unsure what to call it. I hope this thread is in the correct forum.
I'm having problems using xpath to parse some data from an XML file. I am able to create an expression which obtains the elements I wish to retreive, but I'm unsure on how to go about getting their values. So far I have..
public int getTerms(int PMID)
String uri = "http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id="
+ PMID + "&retmode=xml";
// Create an XPath object with the XPathFactory class
XPathFactory factory = XPathFactory.newInstance();
XPath xPath = factory.newXPath();
// Define an InputSource for the XML article
InputSource inputSource = new InputSource(uri);
// Create the expression
String expression = "/PubmedArticleSet/PubmedArticle/MedlineCitation/MeshHeadingList/MeshHeading/DescriptorName";
// Use this expression to obtain a NodeSet of all the MeSH Headings for the article
try
DTMNodeList nodes = (DTMNodeList) xPath.evaluate(expression,
inputSource, XPathConstants.NODESET);
int length = nodes.getLength();
String[] terms = new String[length];
// Test mesh terms are being stored.
*for (int i=0; i<length; i++)*
* System.out.println(i + ": " + nodes.item(i).getNodeValue());*
return nodes.getLength();
catch (XPathExpressionException e2)
{ System.out.println("Article with PMID " + PMID + " has no associated MeSH terms");}
// return a default
return 0;
} The part in bold is the problematic code. I wish to retreive the values of each of the nodes I have taken into my DTMNodeList using a for loop to iterate through each node, and use the getNodeValue() method from the Node class which should return a string. However, the values I retreive are NULL. In the test document I use, the elements do have values.
Here is a snippet of the XML file I am reading in:
<MeshHeadingList>
<MeshHeading>
<DescriptorName MajorTopicYN="N">Binding Sites</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Chromatium</DescriptorName>
<QualifierName MajorTopicYN="Y">enzymology</QualifierName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="Y">Cytochrome c Group</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Electron Spin Resonance Spectroscopy</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Flavins</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Heme</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Iron</DescriptorName>
<QualifierName MajorTopicYN="N">analysis</QualifierName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Magnetics</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Oxidation-Reduction</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Protein Binding</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Protein Conformation</DescriptorName>
</MeshHeading>
- <MeshHeading>
<DescriptorName MajorTopicYN="N">Temperature</DescriptorName>
</MeshHeading>
</MeshHeadingList>Any help would be appreciated.. thanks :-)Answered my own question....
The element value is actually the child of the node I am current at, so instead of doing:
i + ": " + nodes.item(i).getNodeValue()); I should have really done:
i + ": " + nodes.item(i).getChildNode().getNodeValue()); -
Problem using relative sizes on a HTMLtext
Hi
I have a problem using relative sizes on a HTMLtext on Flash
ActionsScript
2.0
Something like:
htmltext= '<font size="+5">TITLE</font>Text
Praragraph...'
(+5 in normal HTML means is 5 points bigger than the standard
text.)
I create the the textArea i set the size and everything if I
do it by
actionscript everything works fine except when i setup the
htmltext, the
text disspears so I need to re-set the embeded font with:
myTextFormat.font = Varfont;
textBox.embedFonts = true;
textBox.setTextFormat(myTextFormat);
But using this lines I lose the previous size. that i
assigned before when i
created the textarea. And goes to a standard size... dont
know why, i am
using a different TextFormat.....
And If i want to use the size i was using , all the text
becomes the same
size (but is the size that I want)...
If I create the text area manually using the gui, it works
well.
¬_¬
>-------------------------------------------------------------------------------------<
The main problem is... why the the text dissapears when i set
a new html
text???
>-------------------------------------------------------------------------------------<
Thanks.1. Really there are a few functions that i skiped yesterday:
3. The font is linked and embeded in library.
public function setHTMLText(texto:String):Void {
textBox.html = true;
textBox.htmlText = texto;
public function setEmbedFont(__font) {
_font = __font;
_embed = true;
setTextStyle(__font);
public function setTextStyle(__font:String, __bold:Boolean,
__underline:Boolean, __italic:Boolean) {
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = _font;
textBox.setTextFormat(myTextFormat);
public function setTextSize(__size:Number) {
var myTextSize:TextFormat = new TextFormat();
myTextSize.size = _size;
textBox.setTextFormat(myTextSize);
Kind of constructor:
autotext_txt.setTextSize(20);
//1 if I activate this one the text will dissapear after
asigning a new
text. And I will need to apply the embed font again.
autotext_txt.setEmbedFont("Arial2");
autotext_txt.setHTMLText(This is a text (big text) | <font
size="-5"
color="#dddddd"> Small Text</font>');
autotext_txt.setEmbedFont("Arial2");
Why dont u have a try?
Thanks,
J
"kglad" <[email protected]> escribió en
el mensaje
news:elo6bk$pu3$[email protected]..
> 1. where's Varfont defined?
> 2. htmtext should be htmlText.
> 3. have you defined a linkage id for a library font? -
I'm having a problem using c:forEach. Eclipse is telling me the problem is with the items parameter, and for the life of me, I cannot see why, since I could swear forEach uses an items parameter. Here is my code and the exception report. Can anyone please help? Thanks.
<table>
<c:forEach var="user" items="${users}">
<tr>
<td>${user.name}</td>
<c:forEach var="education" items="${education}">
<td>${education.school}</td>
<td>${education.major}</td>
<td>${education.degree}</td>
<td>${education.gpa}</td>
</c:forEach>
<c:forEach var="employment" items="${employment}">
<td>${employment.employer}</td>
<td>${employment.jobtitle}</td>
<td>${employment.startdate}</td>
<td>${employment.enddate}</td>
</c:forEach>
</tr>
</c:forEach>
</table>
org.apache.jasper.JasperException: /RecruiterResumeResults.jsp(46,1) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1174)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:821)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1736)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:183)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)In web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">At the top of my JSP:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -
Problem using Toplink with JUnit
Hi,
I have a problem using Toplink with JUnit. Method under test is very simple: it use a static EntityManager object to open a transaction and persists data to db. When I invoke the method from a test method, it gives me the exception:
java.lang.AssertionError
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.computePURootURL(PersistenceUnitProcessor.java:248)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:232)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:216)
at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:239)
at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initializeFromMain(JavaSECMPInitializer.java:278)
at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.getJavaSECMPInitializer(JavaSECMPInitializer.java:81)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:119)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
at it.valerio.electromanager.model.EntityFacade.<clinit>(EntityFacade.java:12)
at it.valerio.electromanager.business.ClienteBiz.insertIntoDatabase(ClienteBiz.java:36)
at it.valerio.electromanager.test.model.ClienteTest.insertDBTest(ClienteTest.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Where is the problem???
Regards,
ValerioEntityFacade class is very simple and it uses a static EntityManager object. Here the code:
public class EntityFacade {
private static EntityManager em = Persistence.createEntityManagerFactory("ElectroManager").createEntityManager();
private static Logger logger=Logger.getLogger(EntityFacade.class);
public static void insertCliente(Cliente c)
logger.debug("Inserisco cliente nel db: " + c);
em.getTransaction().begin();
c.setId(getNextIdForTable("Cliente"));
em.persist(c);
em.getTransaction().commit();
If I call the method from inside a main it works well, so I think the problem is not the classpath neither the URL in the persistence.xml. However the URL is:
<property name="toplink.jdbc.url" value="jdbc:derby:c:/programmi/ElectroManager/db/electroManager"/>
I use the latest build version of TopLink.
Thanks. -
Problem using writeToSource from ORDDoc
Hi
I have some problem using writeToSource
it works it writs on the source but not at the end
it writes at 1st starting position
how i can handle that problem
tanxHi larry
Thanx for cooperation
i am using some way to use lob data but
not pointer execption is really great problem for me
i am giving code an exception too read an give me some suggestions
public void append(String sid)
throws SQLException, ServletException, IOException
String comm1="";
if (conn == null)
getConnection();
conn.setAutoCommit(false);
stmt =(OraclePreparedStatement)conn.prepareStatement(
"select doc from doc_table where doc_number = ? for update");
stmt.setString(1,sid);
if (rset.next())
doc1 = (OrdDoc)rset.getCustomDatum(1,OrdDoc.getFactory() );
}else
rset.close();
stmt.close();
stmt.close();
stmt =(OraclePreparedStatement)conn.prepareStatement(
"select comm from doc_table where doc_number = ?");
stmt.setString(1,sid);
if (rset.next())
comm1 = rset.getString(1);
else
rset.close();
stmt.close();
stmt.close();
byte [][]ctx = new byte[1][64];
byte[] buf = new byte[comm1.length()];
buf = comm1.getBytes();
BLOB doc2 = doc1.getContent();
OracleCallableStatement open_st =
(OracleCallableStatement) conn.prepareCall(
"BEGIN " +
" DBMS_LOB.CREATETEMPORARY(doc2,TRUE,DBMS_LOB.SESSION); "+
" DBMS_LOB.OPEN(doc2,DBMS_LOB.LOBREADWRITE);"+
" DBMS_LOB.WRITEAPPEND(doc2,comm1.length(),comm1);" +
" END;");
//open_st.registerOutParameter(1,doc2);
//open_st.registerOutParameter(2,comm1.length());
// open_st.registerOutParameter(3,comm1);
open_st.execute();
close_st =(OracleCallableStatement)conn.prepareCall(
"BEGIN DBMS_LOB.CLOSE(?); END;");
BLOB temp = open_st.getBLOB(1);
InputStream in = temp.getBinaryStream();
doc1.loadDataFromInputStream(in);
in.close();
//close_st.setBLOB(1,temp);
stmt = (OraclePreparedStatement)conn.prepareStatement(
"update doc_table set doc = ? where doc_number = ? ");
stmt.setCustomDatum(1,doc1);
stmt.setString(2,sid);
stmt.execute();
rset.close();
stmt.close();
conn.commit();
java.lang.NullPointerException
at SQLObject.append(SQLObject.java:64)
at demo.sample._comments._jspService(_comments.java:136) -
N-Queens Problem Using Stacks Help
I'm trying to solve the N-Queens problem using Stacks. Quite frankly, I'm completely lost.
Here's the pseudocode from the book:
"Push information onto the stack indicating the first choice is a queen in row 1, column 1.
success = false;
while(!success && !s.isEmpty())
Check whether the most recent choice (on top of the stack) is in the same row, same column, or same diagonal as any other choices (below the top). If so, we say there is a conflict: otherwise, there is no conflict.
if (there is a conflict)
-Pop items off the stack until the stack becomes empty or the top of the stack is a choice that is not in column n. If the stack is now not empty, then increase the column number of the top choice by 1.
else if (no conflict and the stack size is n)
-Set success to true because we have found a solution to the n-queens problem.
else
-Push information onto the stack indicating tat the next choice is to place a queen at row number s.size()+1 and column number 1.
And here is my excuse for code so far. I have no idea how to check the diagonals, or how to even really make this work
{code}import java.util.Stack;
public class NQueens {
int row, column, n;
public NQueens(int n) {
row = 0;
column = 0;
n = n;
public Stack Solve(){
boolean success, conflict;
Stack<NQueens> Qs = new Stack<NQueens>();
if (Qs.size() == 0)
Qs.push(new NQueens(1));
success = false;
while (!success && !Qs.isEmpty())
if (Qs.peek().row == row)
conflict = true;
if (Qs.peek().column == column)
conflict = true;
if (conflict = true)
Qs.pop();
Qs.peek().column += 1;
else
if (!conflict && Qs.size() == n)
success = true;
else
Qs.push(new NQueens(Qs.size()+1));
return Qs;
{code}First off I'll address this:
int row, column, n;
public NQueens(int n) {
row = 0;
column = 0;
n = n; //here
}Notice the last line of that. I get what you're trying to do, but think about what the compiler sees there. If you have two variables called 'n', one at the class level, and one at the method level, the compiler must have rules so it knows which one you're talking about. And if it follows those rules, then saying 'n' inside that method must always refer to the same n. Otherwise, how would it decide which one you're talking about? The rule here is that it uses the most local variable available to it, which in this case is your method parameter. So 'n = n' is setting the parameter equal to itself. To refer to the class variable n, use "this.n", like so:
this.n = n;Now that that's settled, let's address some logic. You'll need to figure out whether two Queens share a diagonal. I can think of at least a couple options for that. First, every time you look at a Queen you could loop through the entire board and make sure that if a piece is in r3c4, that no piece is in r2c3,r4c5,r5c6, etc. Or you could create a new variable for your class similar to your 'row' and 'column' variables that tracks the diagonal a piece is in. But that requires some calculating. And remember, there's 2 directions for diagonals, so you'll need 2 diagonal variables.
If these are your Row and Column values:
Row Column
00000000 01234567
11111111 01234567
22222222 01234567
33333333 01234567
44444444 01234567
55555555 01234567
66666666 01234567
77777777 01234567And these are your diagonal values:
Diag 1 Diag 2
0 1 2 3 4 5 6 7 7 6 5 4 3 2 1 0
1 2 3 4 5 6 7 8 8 7 6 5 4 3 2 1
2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2
3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3
4 5 6 7 8 9 10 11 11 10 9 8 7 6 5 4
5 6 7 8 9 10 11 12 12 11 10 9 8 7 6 5
6 7 8 9 10 11 12 13 13 12 11 10 9 8 7 6
7 8 9 10 11 12 13 14 14 13 12 11 10 9 8 7Then examine the relationship between Row(R), Column(C), and Diagonals 1 and 2 (D1/D2):
RC D1,D2
00 = 0,7
01 = 1,6
02 = 2,5
03 = 3,4
04 = 4,3
05 = 5,2
06 = 6,1
07 = 7,0
10 = 1,8
11 = 2,7
12 = 3,6
13 = 4,5
14 = 5,4
15 = 6,3
16 = 7,2
17 = 8,1You'll notice that D1 is always the same as R + C. And D2 is always the same as C subtracted from 7 plus R, giving:
int d1 = row + column;
int d2 = (7 + row) - column;But remember, that 7 in the formula above, is based on how big your grid is. So whatever your 'N' is, whether its a 10x10 square or a 574x574 square, that 7 should be changed to (N-1)
So those could be your variables to track diagonals. What I'm noticing in your current code, is that you never change your row and column variables...so every Queen is always at r0c0. You should probably put values for those in your parameters for the constructor, in addition to n. Then the diagonals can be calculated from those.
Edited by: newark on Apr 17, 2008 10:46 AM -
Tunneling Problem using HttpsUrlConnection
Hi,
I had gone through forums regarding this topic and still i am facing the same problem using the HttpsUrlConnection. We are working behind a proxy so we have to make a proxy authorization if we want to connect to a server in the internet.
But in case of HttpUrlConnection, everything works
fine. But if we do the same with a HttpsUrlConnection, the authentication fails. It throws an IOException
with the message
Unable to tunnel through 192.9.100.10:80.
Proxy returns "HTTP/1.1 407 Proxy authentication required"
Sample code as follows,
The following code doesn't have any problem becos it works fine with HttpUrlConnection and also it is working without proxyserver for https as well.
This is running under MSVM.
I don't want to use SSLSocketFactory and i need to use following layout(i.e only with Httpsurlconnection)
Is there any way to make work with proxyserver? Or can't we do this at all?
System.setProperty("proxySet","true");
System.setProperty("https.proxyHost","proxyIP");
System.setProperty("https.proxyPort","80");
OutputStream os = null;
OutputStreamWriter osw = null;
InputStream is = null;
InputStreamReader isr = null;
BufferedReader br = null;
URL url;
String line = null;
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
String login = proxyUserName+":"+proxyPassWord;
String encodedLogin = new sun.misc.BASE64Encoder().encode(login.getBytes());
url = new URL("https://www.verisign.com");
HttpsURLConnection con = null;
con =(HttpsURLConnection) url.openConnection();
con.setRequestProperty("Proxy-Authorization", encodedLogin);
con.setRequestMethod("GET");
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
con.connect();
os = con.getOutputStream();
osw = new OutputStreamWriter(os);
osw.write("SampleMsg");
osw.flush();
osw.close();
is = con.getInputStream();
isr = new InputStreamReader(is);
br = new BufferedReader(isr);
while ( (line = br.readLine()) != null)
System.out.println("line: " + line);
Can any one help me regarding this?I need a reply very urgently.
Thanks,
Prabhakaran RHope this help.
Note to change the properties to fit your system, and use the supported package ( JSSE, JRE1.5.......).
You can use URLConnection for both HTTP or HTTPS protocol.
import java.io.*;
import java.net.*;
import java.security.*;
import java.util.*;
import javax.net.ssl.*;
public class testSSL9 {
public testSSL9() {
byte[] data = httpConnection();
System.out.println(new String(data));
public static void main(String[] args) {
Properties sysprops = System.getProperties();
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
// sysprops.put("java.protocol.handler.pkgs",
// "com.sun.net.ssl.internal.www.protocol");
sysprops.put("java.protocol.handler.pkgs",
"javax.net.ssl.internal.www.protocol");
sysprops.put("javax.net.ssl.trustStore",
"D:/jdk1.4/jre/lib/security/cacerts");
sysprops.put("javax.net.debug", "ssl,handshake,data,trustmanager");
sysprops.put("https.proxyHost", "172.16.0.1");
sysprops.put("https.proxyPort", "3128");
sysprops.put("https.proxySet", "true");
sysprops.put("http.proxyHost", "172.16.0.1");
sysprops.put("http.proxyPort", "3128");
sysprops.put("proxySet", "true");
testSSL9 testSSL91 = new testSSL9();
private byte[] httpConnection() {
try {
URL url = null;
// String strurl = "https://www.verisign.com";
String strurl = "https://central.sun.net";
// String strurl = "http://www.yahoo.com"; --> use: HttpURLConnection
url = new URL(strurl);
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
HttpsURLConnection.setFollowRedirects(false);
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setUseCaches(false);
connection.connect();
InputStream stream = null;
BufferedInputStream in = null;
ByteArrayOutputStream bytearr = null;
BufferedOutputStream out = null;
try {
stream = connection.getInputStream();
in = new BufferedInputStream(stream);
bytearr = new ByteArrayOutputStream();
out = new BufferedOutputStream(bytearr);
catch (Exception ex1) {
System.out.println(ex1);
System.out.println("Server reject connection...sory");
int i = 0;
while ( (i = in.read()) != -1) {
out.write(i);
out.flush();
stream.close();
in.close();
bytearr.close();
out.close();
return bytearr.toByteArray();
catch (Exception ex) {
ex.printStackTrace();
return null;
} -
Problem using SmartCard with 2 Certificates stored and SunPKCS11
Hi,
I'm trying to access one SmartCard token in Java 1.5 using SunPKCS11 provider for crypt, decrypt and digital signature operations.
I have 2 certificates stored on Token:
- CertA;
- CertB.
There are also 2 PIN:
- PIN1;
- PIN2.
I use:
- PIN1 for logging into the token;
- PIN1 for operation involving CertA;
- PIN2 for operation involving CertB;
There is no problem to logging into the token using Java and, without any troubles, I can read certificates and key from the
cryptographic card.
There is no problem using CertA for all my operation, but every attempt of using Private Key of CertB (for the same operations) returns with an Exception:
java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
Here there's an extract of my source code.
public void loginToken() {
Provider UserProvider = new sun.security.pkcs11.SunPKCS11(C:\\pkcs11.cfg);
Security.addProvider(UserProvider);
try {
KeyStore ks = null;
X509Certificate UserCert = null;
PrivateKey UserCertPrivKey = null;
PublicKey UserCertPubKey = null;
//PIN
char PIN1[] = "11111".toCharArray();
char PIN2[] = "22222".toCharArray();
//logging into token
ks = KeyStore.getInstance("PKCS11", UserProvider);
ks.load(null, PIN1);
//enumeration alias
String alias = "";
Enumeration e = ks.aliases();
while (e.hasMoreElements()) {
alias = (String) e.nextElement();
//Certificate
UserCert = (X509Certificate) ks.getCertificate(alias);
//PublicKey
UserCertPubKey = (PublicKey) ks.getCertificate(alias).getPublicKey();
if (alias.compareToIgnoreCase("Cert1") == 0) {
//PrivateKey reference
UserCertPrivKey = (PrivateKey) ks.getKey(alias, PIN1);
} else if (alias.compareToIgnoreCase("Cert2") == 0) {
//PrivateKey reference
UserCertPrivKey = (PrivateKey) ks.getKey(alias, PIN2);
} else {
System.out.println("ALIAS UNKNOW");
System.exit(1);
//Signature Test
if (!MakeSignature(UserCertPrivKey, UserProvider))
System.out.println(" *** SIGNATURE OK *** ");
else
System.out.println(" *** SIGNATURE KO *** ");
catch (Exception ex) {
System.out.println("ERROR: " + ex);
public boolean MakeSign(PrivateKey PrivKey, Provider p) {
try {
//File I/O
FileInputStream txtfis = new FileInputStream("C:\\Test.txt");
FileOutputStream sigfos = new FileOutputStream("C:\\Test_Signature.txt");
//Signature Obj init
Signature dsa = Signature.getInstance("SHA1withRSA", p.getName());
dsa.initSign(PrivKey);
//Update data
BufferedInputStream bufin = new BufferedInputStream(txtfis);
byte[] buffer = new byte[1024];
int len;
while (bufin.available() != 0) {
len = bufin.read(buffer);
dsa.update(buffer, 0, len);
bufin.close();
//Make signature
byte[] realSig = dsa.sign();
//save signature on file
sigfos.write(realSig);
sigfos.close();
return true;
catch (Exception ex) {
System.out.println("ERROR: " + ex);
return false;
Any help would be grateful...
Thanks in advance.
P.S. Sorry for my EnglishThis is the same my initial problem.
I resolved it using IAIK-PKCS#11Wrapper (it is FREE) insted of sun.security.pkcs11.SunPKCS11.
You can find it here:
http://jce.iaik.tugraz.at/sic/products/core_crypto_toolkits/pkcs_11_wrapper
Here an exemple of code.
The main class:
import iaik.pkcs.pkcs11.Module;
import iaik.pkcs.pkcs11.DefaultInitializeArgs;
import java.util.Hashtable;
import iaik.pkcs.pkcs11.Token;
import iaik.pkcs.pkcs11.Slot;
import iaik.pkcs.pkcs11.Session;
import iaik.pkcs.pkcs11.objects.RSAPrivateKey;
import java.util.Vector;
import iaik.pkcs.pkcs11.objects.PrivateKey;
import iaik.pkcs.pkcs11.objects.X509PublicKeyCertificate;
import java.util.Enumeration;
import iaik.pkcs.pkcs11.objects.Key;
import java.security.cert.CertificateFactory;
import java.io.ByteArrayInputStream;
import iaik.pkcs.pkcs11.Mechanism;
import java.security.Security;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.io.File;
import java.io.FileInputStream;
import org.bouncycastle.cms.CMSSignedDataGenerator;
import org.bouncycastle.cms.CMSProcessableByteArray;
import java.util.ArrayList;
import java.security.cert.CertStore;
import java.security.cert.CollectionCertStoreParameters;
import org.bouncycastle.cms.CMSSignedData;
import java.io.FileOutputStream;
import java.security.cert.X509Certificate;
import iaik.pkcs.pkcs11.TokenInfo;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
public class MakeSignature {
public static void main(String[] args) {
String USER_PIN = "12345678";
String DLL_NAME = "C:\\windows\\system32\\dll_P11_name.dll";
String OBJ_LABEL1 = "CNS0"; //this is the label of my 1th cert
String OBJ_LABEL2 = "CNS1"; //this is the label of my 2th cert
String INPUT_FILE = "C:\\Temp\\test.txt";
String OUTPUT_FILE = "C:\\Temp\\test.p7m";
try {
// ********** INITIALIZE PKCS#11 MODULE WITH DEFAULT PARAMETERS **********
Module pkcs11Module = Module.getInstance(DLL_NAME);
pkcs11Module.initialize(new DefaultInitializeArgs());
// ********** SELECT TOKEN **********
Slot[] slotsWithToken = pkcs11Module.getSlotList(Module.SlotRequirement.TOKEN_PRESENT);
Token[] tokens = new Token[slotsWithToken.length];
Hashtable tokenIDtoToken = new Hashtable(tokens.length);
long tokenID = -1;
Token tokenUsed = null;
//enum readers
for (int i = 0; i < slotsWithToken.length; i++) {
tokens[i] = slotsWithToken.getToken();
tokenID = tokens[i].getTokenID();
tokenIDtoToken.put(new Long(tokenID), tokens[i]);
System.out.println("Active tokens:");
System.out.println("Token ID: " + tokenID);
if (tokens.length == 0) { //No SC found
System.out.println("No SC presents");
else {
System.out.println("Using token: " + tokens[0].getTokenID());
tokenUsed = tokens[0];
//Note: if you have more reader and more SC inserted, you have to write
//here the code for select the right token
// ********** OPEN SESSION VS THE TOKEN AND IF REQUIRED SUBMIT PIN **********
TokenInfo tokenInfo = tokenUsed.getTokenInfo();
Session session = tokenUsed.openSession(Token.SessionType.SERIAL_SESSION, false, null, null);
if (tokenInfo.isLoginRequired()) {
session.login(Session.UserType.USER, USER_PIN.toCharArray());
// ********** SET SEARCH TEMPLATE FOR THE P11 OBJECT **********
RSAPrivateKey privateSignatureKeyTemplate = new RSAPrivateKey();
privateSignatureKeyTemplate.getSign().setBooleanValue(Boolean.TRUE);
privateSignatureKeyTemplate.getLabel().setCharArrayValue(OBJ_LABEL2.toCharArray());
// ********** SEARCH P11 OBJECT USING TEMPLATE **********
Vector keyList = new Vector(4);
session.findObjectsInit(privateSignatureKeyTemplate);
Object[] matchingKeys;
while ( (matchingKeys = session.findObjects(1)).length > 0) {
keyList.addElement(matchingKeys[0]);
session.findObjectsFinal();
//Try to find the corresponding certificates for the signature keys
Hashtable keyToCertificateTable = new Hashtable(4);
Enumeration keyListEnumeration = keyList.elements();
while (keyListEnumeration.hasMoreElements()) {
PrivateKey signatureKey = (PrivateKey) keyListEnumeration.nextElement();
byte[] keyID = signatureKey.getId().getByteArrayValue();
X509PublicKeyCertificate certificateTemplate = new X509PublicKeyCertificate();
certificateTemplate.getId().setByteArrayValue(keyID);
session.findObjectsInit(certificateTemplate);
Object[] correspondingCertificates = session.findObjects(1);
if (correspondingCertificates.length > 0) {
keyToCertificateTable.put(signatureKey, correspondingCertificates[0]);
session.findObjectsFinal();
//There are three cases now: 1 no obj found; 2 found only one obj, 3 found more obj
Key selectedKey = null;
X509PublicKeyCertificate correspondingCertificate = null;
//no object found for template
if (keyList.size() == 0) {
System.out.println("No object found for template");
throw new Exception("No object found for template");
//Founf only one object
else if (keyList.size() == 1) {
selectedKey = (Key) keyList.elementAt(0);
// create a IAIK JCE certificate from the PKCS11 certificate
correspondingCertificate = (X509PublicKeyCertificate)keyToCertificateTable.get(selectedKey);
System.out.println("One object Found");
//Found more object ... user can select one
else {
System.out.println("Many obj found!!!");
//write here the code for select the right object
// ********** GET THE OBJECT **********
RSAPrivateKey signerPriKey = (RSAPrivateKey) selectedKey;
java.security.cert.CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
byte[] derEncodedCertificate = correspondingCertificate.getValue().getByteArrayValue();
//Cast to java.security.cert.X509Certificate
java.security.cert.X509Certificate signerCert = (java.security.cert.X509Certificate) certificateFactory.
generateCertificate(new ByteArrayInputStream(derEncodedCertificate));
// ********** SIGNATURE OPERATION **********
//Add BouncyCastle as provider
Security.addProvider(new BouncyCastleProvider());
//initialize signature operation
session.signInit(Mechanism.RSA_PKCS, (PrivateKey) signerPriKey);
//get input data
File src = new File(INPUT_FILE);
int sizecontent = ( (int) src.length());
byte[] contentData = new byte[sizecontent];
FileInputStream freader = new FileInputStream(src);
freader.read(contentData, 0, sizecontent);
freader.close();
//calculate digest of the input data
byte[] toEncrypt = buildBits(contentData); //I've already posted the code for this function
//make signature
byte[] signature = session.sign(toEncrypt);
// ********** MAKE P7 WELL FORMAT DOCUMENT **********
//CMSSignedDataGenerator fact = new CMSSignedDataGenerator();
Signature2CMSSignedData fact = new Signature2CMSSignedData();
CMSProcessableByteArray content = new CMSProcessableByteArray(contentData);
//Creation of BC CertStore
ArrayList certList = new ArrayList();
certList.add(signerCert);
CertStore certs = CertStore.getInstance("Collection", new CollectionCertStoreParameters(certList), "BC");
//Signature Alg
String algorithm = CMSSignedDataGenerator.DIGEST_SHA1;
//add element to P7
fact.addSignature(signature, signerCert, algorithm);
fact.addCertificatesAndCRLs(certs);
//generate enveloped using Bouncycastle provider
CMSSignedData envdata = fact.generate(PKCSObjectIdentifiers.data.getId(), content, true);
byte[] enveloped = envdata.getEncoded();
//Write P7 file
FileOutputStream efos = new FileOutputStream(OUTPUT_FILE);
efos.write(enveloped);
efos.close();
// ********** END **********
session.closeSession();
pkcs11Module.finalize(null);
catch (Exception ex) {
ex.printStackTrace();
}Main class uses buildBits function (already posted in this topic) and Signature2CMSSignedData class.import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.security.cert.CertStore;
import java.security.cert.X509CRL;
import java.security.cert.X509Certificate;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1Set;
import org.bouncycastle.asn1.BERConstructedOctetString;
import org.bouncycastle.asn1.DEREncodable;
import org.bouncycastle.asn1.DERNull;
import org.bouncycastle.asn1.DERObject;
import org.bouncycastle.asn1.DERObjectIdentifier;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DERSet;
import org.bouncycastle.asn1.cms.ContentInfo;
import org.bouncycastle.asn1.cms.IssuerAndSerialNumber;
import org.bouncycastle.asn1.cms.SignedData;
import org.bouncycastle.asn1.cms.SignerIdentifier;
import org.bouncycastle.asn1.cms.SignerInfo;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.asn1.x509.CertificateList;
import org.bouncycastle.asn1.x509.TBSCertificateStructure;
import org.bouncycastle.asn1.x509.X509CertificateStructure;
import org.bouncycastle.cms.CMSProcessable;
import org.bouncycastle.cms.CMSSignedData;
* class for generating a RSA pkcs7-signature message.
public class Signature2CMSSignedData2 {
CertStore certStore;
List certs = new ArrayList();
List crls = new ArrayList();
List signerInfs = new ArrayList();
List signers = new ArrayList();
public static final String DATA = PKCSObjectIdentifiers.data.getId();
public static final String ENCRYPTION_RSA = "1.2.840.113549.1.1.1";
private byte[] signatureData = null;
private X509Certificate cert = null;
private String digestOID = null;
private String encOID = null;
public Signature2CMSSignedData2() {
public void addSignature(byte[] signatureData, X509Certificate cert, String digestOID) {
this.signatureData = signatureData;
this.cert = cert;
this.digestOID = digestOID;
this.encOID = ENCRYPTION_RSA;
public void addCertificatesAndCRLs(CertStore certStore) throws Exception{
try {
Iterator it = certStore.getCertificates(null).iterator();
while (it.hasNext()) {
X509Certificate c = (X509Certificate) it.next();
certs.add(new X509CertificateStructure((ASN1Sequence) makeObj(c.getEncoded())));
Iterator it2 = certStore.getCRLs(null).iterator();
while (it2.hasNext()) {
X509CRL c = (X509CRL) it2.next();
crls.add(new CertificateList((ASN1Sequence) makeObj(c.getEncoded())));
catch (Exception e) {
throw new Exception(e.getMessage());
private DERObject makeObj(byte[] encoding) throws Exception {
if (encoding == null) {
return null;
ByteArrayInputStream bIn = new ByteArrayInputStream(encoding);
ASN1InputStream aIn = new ASN1InputStream(bIn);
return aIn.readObject();
public CMSSignedData generate(String signedContentType, CMSProcessable content, boolean encapsulate) throws Exception {
try {
ASN1EncodableVector digestAlgs = new ASN1EncodableVector();
ASN1EncodableVector signerInfos = new ASN1EncodableVector();
DERObjectIdentifier contentTypeOID = new DERObjectIdentifier(signedContentType);
// add the SignerInfo objects
Iterator it = signerInfs.iterator();
AlgorithmIdentifier digAlgId = new AlgorithmIdentifier(new DERObjectIdentifier(digestOID), new DERNull());
AlgorithmIdentifier encAlgId;
encAlgId = new AlgorithmIdentifier(new DERObjectIdentifier(encOID), new DERNull());
digestAlgs.add(digAlgId);
ASN1Set signedAttr = null;
ASN1Set unsignedAttr = null;
ASN1OctetString encDigest = new DEROctetString(signatureData);
ByteArrayInputStream bIn = new ByteArrayInputStream(cert.getTBSCertificate());
ASN1InputStream aIn = new ASN1InputStream(bIn);
TBSCertificateStructure tbs = TBSCertificateStructure.getInstance(aIn.readObject());
IssuerAndSerialNumber encSid = new IssuerAndSerialNumber(tbs.getIssuer(), tbs.getSerialNumber().getValue());
signerInfos.add(new SignerInfo(new SignerIdentifier(encSid), digAlgId, signedAttr, encAlgId, encDigest, unsignedAttr));
ASN1Set certificates = null;
if (certs.size() != 0) {
ASN1EncodableVector v = new ASN1EncodableVector();
it = certs.iterator();
while (it.hasNext()) {
v.add( (DEREncodable) it.next());
certificates = new DERSet(v);
ASN1Set certrevlist = null;
if (crls.size() != 0) {
ASN1EncodableVector v = new ASN1EncodableVector();
it = crls.iterator();
while (it.hasNext()) {
v.add( (DEREncodable) it.next());
certrevlist = new DERSet(v);
ContentInfo encInfo;
if (encapsulate) {
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
content.write(bOut);
ASN1OctetString octs = new BERConstructedOctetString(bOut.toByteArray());
encInfo = new ContentInfo(contentTypeOID, octs);
else {
encInfo = new ContentInfo(contentTypeOID, null);
SignedData sd = new SignedData(new DERSet(digestAlgs), encInfo, certificates, certrevlist, new DERSet(signerInfos));
ContentInfo contentInfo = new ContentInfo(PKCSObjectIdentifiers.signedData, sd);
return new CMSSignedData(content, contentInfo);
catch (Exception e) {
throw new Exception(e.getMessage());
}Bye. -
Problem using SQL Loader with ODI
Hi,
I am having problems using SQL Loader with ODI. I am trying to fill an oracle table with data from a txt file. At first I had used "File to SQL" LKM, but due to the size of the source txt file (700MB), I decided to use "File to Oracle (SQLLDR)" LKM.
The error that appears in myFile.txt.log is: "SQL*Loader-101: Invalid argument for username/password"
I think that the problem could be in the definition of the data server (Physical architecutre in topology), because I have left blank Host, user and password.
Is this the problem? What host and user should I use? With "File to SQL" works fine living this blank, but takes to much time.
Thanks in advanceI tried to use your code, but I couldn´t make it work (I don´t know Jython). I think the problem could be with the use of quotes
Here is what I wrote:
import os
retVal = os.system(r'sqlldr control=E:\Public\TXTODI\PROFITA2/Profita2Final.txt.ctl log=E:\Public\TXTODI\PROFITA2/Profita2Final.txt.log userid=MYUSER/myPassword @ mySID')
if retVal == 1 or retVal > 2:
raise 'SQLLDR failed. Please check the for details '
And the error message is:
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 5, in ?
SQLLDR failed. Please check the for details
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.h.y(h.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source) -
Hi,
I have a question on using EJB / or RMI servers with CORBA clients using
RMI-IIOP transport, which in theory should work, but in practice has few
glitches.
Basically, I have implemented a very simple server, StockTreader, which
looks up for a symbol and returns a 'Stock' object. In the first example, I
simplified the 'Stock' object to be a mere java.lang.String, so that lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case 1) and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
But the problem arises when I tried using the RMI server (via IIOP) with the
CORBA client, when the client tries to narrow the object ref obtained from
the naming service into the CORBA idl defined type (StockTrader) it ends up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a PortableRemoteObject derived
class, to make it IIOP compliant), and then the server to register the stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming =NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ": " +obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to register the RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref name (with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the naming
service, the operation StockTraderHelper.narrow() fails in the segment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registered in a CORBA
server (as opposed to an RMI server), but works correctly with no casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hariOn the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
include the examples.
"<=one way=>" wrote:
With reference to your and other messages, it appears that one should not
expect that WLS RMI-IIOP will work in a complex real-life system, at least
not now. In other words, support for real-life CORBA clients is not an
option in the current release of WLS.
TIA
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
needs for uses who need to use IDL to talk to the Weblogic server,
generically. This example illustrates the simplest connectivity; it does not
address how
to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
this topic either, a point which is telling if all the less happy to hear.
For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
correct; better examples are forth coming.
Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
programming model is busted; busted in the sense that there are no C++
libraries to support the EJB model, and busted in the sense that there is
simply no
support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
in productive ways.
For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
dispatch IIOP request into RMI server objects. The way I look at it is this:
it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
practically nothing to do with CORBA.
ST wrote:
Eduardo,
Can you give us more details about the comment below:
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
implementation. We
don't need a "HelloWorld" example, we need a concrete serious example(fully
tested and seriously documented) that works so that we can get a betteridea
on how to integrate CORBA and EJB.
Thanks,
Said
"Eduardo Ceballos" <[email protected]> wrote in message
news:[email protected]...
Please post request to the news group...
As I said, you must separate the idl related classes (class files and
java
files) from the rmi classes... in the rmic step, you must set a newtarget
(as you did), emit the java files into that directory (it's not clearyou
did this), then remove all the rmi class files from the class path... ifyou
need to compile more classes at that point, copy the java files to theidl
directly is you must, but you can not share the types in any way.
I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
an idl client in java to work.
Harindra Rajapakshe wrote:
Hi Eduardo,
Thanks for the help. That is the way I compiled my CORBA client, by
separating the IDL-generated stubs from the RMI ones, but still I
get a
CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
Here's what I did;
+ Define the RMI interfaces, in this case a StockTrader interface.
+ Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
making
it IIOP compliant
+ Implemnnt an RMI server, and compile using JDK1.2.2
+ use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
utility rmic;
rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
+ generate Java mappings to the IDL generated above, using RMI-IIOPplugin
util,
idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
This creates source for the package stock and also
org.omg.CORBA.*
package, presumably IIOP type marshalling
+ compile all classes generated above using JDK1.2.2
+ Implement client (CORBA) using the classes generated above, NOTthe
RMI
proxies.
+ start RMI server, with stockTrader server obj
+ start tnameserv
+ start CORBA client
Then the client errors when trying to narrow the obj ref from the
naming
service, into the CORBA IDL defined interface using,
org.omg.CORBA.Object obj =naming.resolve(nn);
StockTrader trader =StockTraderHelper.narrow(obj); // THIS
ERRORS..!!!
throwing a CORBA.BAD_PARAM exception.
any ideas..?
Thanks in advance,
-hari
----- Original Message -----
From: Eduardo Ceballos <[email protected]>
Newsgroups: weblogic.developer.interest.rmi-iiop
To: Hari Rajapakshe <[email protected]>
Sent: Wednesday, July 26, 2000 4:38 AM
Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
Please see the post on june 26, re Errors compiling... somewherein
there,
I suspect, you are referring to the rmi class file when you are
obliged
to
completely segregate these from the idl class files.
Hari Rajapakshe wrote:
Hi,
I have a question on using EJB / or RMI servers with CORBA
clients
using
RMI-IIOP transport, which in theory should work, but in practice
has
few
glitches.
Basically, I have implemented a very simple server,
StockTreader,
which
looks up for a symbol and returns a 'Stock' object. In the firstexample, I
simplified the 'Stock' object to be a mere java.lang.String, so
that
lookup
would simply return the 'synbol'.
Then I have implemented the above, as an RMI-IIOP server (case
1)
and a
CORBA server (case 2) with respective clients, and the pair of
client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
But the problem arises when I tried using the RMI server (via
IIOP)
with
the
CORBA client, when the client tries to narrow the object ref
obtained
from
the naming service into the CORBA idl defined type (StockTrader)
it
ends
up
with a class cast exception.
This is what I did to achieve the above results:
[1] Define an RMI interface StockTrader.java (extending
java.rmi.Remote)
with the method,
public String lookup( String symbol) throws RMIException;
[2] Implement the StorckTrader interface (on a
PortableRemoteObject
derived
class, to make it IIOP compliant), and then the server to
register
the
stock
trader with COS Naming service as follows:
String homeName =....
StockTraderImpl trader =new StockTraderImpl();
System.out.println("binding obj <" homeName ">...");
java.util.Hashtable ht =new java.util.Hashtable();
ht.put("java.naming.factory.initial", args[2]);
ht.put("java.naming.provider.url", args[3]);
Context ctx =new InitialContext(ht);
ctx.rebind(homeName, trader);
[3] Generate the RMI-IIOP skeletons for the Implementation
class,
rmic -iiop stock.StockTraderImpl
[4] generate the IDL for the RMI interface,
rmic -idl stock.StockTraderImpl
[5] Generate IDL stubs for the CORBA client,
idlj -v -fclient -emitAll StockTraderImpl.idl
[6] Write the client to use the IDL-defined stock trader,
String serverName =args[0];
String symList =args[1];
StockClient client =new StockClient();
System.out.println("init orb...");
ORB orb =ORB.init(args, null);
System.out.println("resolve init name service...");
org.omg.CORBA.Object objRef
=orb.resolve_initial_references("NameService");
NamingContext naming=NamingContextHelper.narrow(objRef);
... define a naming component etc...
org.omg.CORBA.Object obj =naming.resolve(...);
System.out.println("narrow objRef: " obj.getClass() ":"
+obj);
StockTrader trader =StockTraderHelper.narrow(obj);
[7] Compile all the classes using Java 1.2.2
[8] start tnameserv (naming service), then the server to
register
the
RMI
server obj
[9] Run the CORBA client, passing it the COSNaming service ref
name
(with
which the server obj is registered)
The CORBA client successfully finds the server obj ref in the
naming
service, the operation StockTraderHelper.narrow() fails in thesegment
below, with a class cast exception:
org.omg.CORBA.Object obj =naming.resolve(...);
StockTrader trader =StockTraderHelper.narrow(obj);
The <obj> returned by naming service turns out to be of the
type;
class com.sun.rmi.iiop.CDRInputStream$1
This is of the same type when stock trader object is registeredin a
CORBA
server (as opposed to an RMI server), but works correctly with
no
casting
excpetions..
Any ideas / hints very welcome.
thanks in advance,
-hari -
NetStream publish audioloss problem using FMS 3.5
Hi All,
I am new to flex 3.2.0 and FMS 3.5. I have problem using netstream data publish (i.e.record) the audio from client to FMS server. I tried NetStreamInfo class in flash player 10. Alert will show zero value.
nsi = recordStream.info;
if (nsi){
Alert.show( nsi.audioLossRate.toString() );
how to avoid data loss over the network. Please help
Thanks
ArulkumarAdding to my previous post this is the XML output i get when i try to access the fms admin console from local ip address i.e http://192.168.10.19:1111/fms_adminConsole.htm
<?xml version="1.0" encoding="utf-8" ?>
- <result>
<level>error</level>
<code>NetConnection.Connect.Rejected</code>
<description>Admin user requires valid username and password.</description>
<timestamp>2/3/2010 8:26:08 AM</timestamp>
</result>
but when i try to access fms admin console through public ip (http://212.77.xx.xx:1111/fms_adminConsole.htm) then it gives me the following :
Internet Explorer cannot display the webpage.
Any more suggestions Jay (because really ur the only one helping me out in this so far) ?? -
Could not initialize photoshop because of a problem using the adobe color engine (Win 7)
Was running the lastest version of Photoshop CS5 and added a second quad graphics card and 4 more monitors. Now PS will not start and I get the error message "could not initialize photoshop because of a problem using the adobe color engine."
Computer has 2 NIVDIA Quadro4 NVS420 graphics boards with 8 Samsung SyncMaster 1920x1080 monitors. If I disable 4 of the monitors CS5 starts normally. I do not have to remove the added graphics card. When I extend the desktop again to all 8 monitors I get the error above.
How do I trouble-shoot the problem? Is it Photoshop, NIVDIA or Windows 7?Well, not exactly a full solution yet (at least for my setup), but I am certain now that this issue is (mostly) caused by nVidia's drivers. You may be able to fix your setup by simply installing the latest drivers for your NVS420 cards (266.45 for Win 7/64 rel. 01/12/2011).
Since you are using two identical cards, this could do the trick.
Caveats - Make sure you:
1. Select Custom Install, the Express Install will most likely not work properly.
2. Unselect the Audio Driver (if available), the nVidia HD(MI) Audio driver could
screw up your speech recognition (if you use it) or other audio software - it did for me.
3. Select Clean Install. If you don't, files like C:\Windows\System32\drivers\nvlddmkm.sys
and several other driver related files will not be overwritten, causing all sorts of neat effects.
4. After the Install is complete, reboot your system whether the Installer prompts you or not.
After testing various configurations, disabling two - six of my eight monitors I am at this point:
I am now using nVidia's lastest and greatest piece of crap (read driver), version 266.58, released just two days ago. After an initial snag with maximized windows extending to the bottom of the main monitor (underneath the taskbar), a re-install & reboot solved that issue.
All three driver versions tested (260.89, 260.99, 266.58) now allow me to start PhotoShop without any problems; providing I first disable the two monitors fed by my onboard graphics (nVidia 780a based), leaving me with six monitors connected to three GTS-450 cards. I can even re-enable the two other monitors once the program is open, and it continues to work fine. However, I must disconnect them again for the next start of PhotoShop.
On an interesting side note:
After disabling six monitors (leaving only two on a GTS-450), I was also able to open and run SoundBooth CS5, which previously would not open, citing the audio driver as the problem. After sucessfully starting SoundBooth I could re-enable all six other monitors (incl. onboards),
and that program now opens and works fine with all 8 monitors connected. [ODD !!!]
Other than Adobe Software, I've had only one other issue with my setup:
When playing online poker at PokerStars, occasionally and quite randomly one of multiple tables would freeze up. I'll try disabling the two onboard monitors for that program as well to see whether the random freezes stop.
Overall, while I think that Adobe produces fine software and nVidia has been in need of an overhaul for quite some time now, I also think that Adobe and nVidia software engineers need to work more closely together to ensure that problems like this don't arise in the first place after a product has been released to the public. IMHO, this is avoidable!
PS:
Here's a link to a great tool for multiple monitors, Display Fusion by Binary Fortress.
I use the free version, it allows you to do cool things like have individual wallpapers for all
your monitors, or stretch a single image across all monitors. With the Pro Version ($25),
you can also add individually customizable taskbars to each monitor, and a lot more.
http://www.displayfusion.com/
Maybe you are looking for
-
ITunes 7 on XP x64, Vista x64, 2003 x64
I know it's not oficially supported but does anyone know if iTunes 7 will install on any 64 bit Microsoft OS's? as 6.0.4 did? Or is it still unjustly locked out as in 6.0.5?
-
Better to use Aperture or FCPX for import?
I am starting from scratch with FCPX. I have a MBA with a portable thunderbolt drive, and right now this is my primary. I have an older 2008 iMac, and this is my workstation I use for everything when I am at home. I'm on the road more than at home an
-
SSAS Tabular: Show balance on latest dimension attribute
Hi, I have a fact with transactions over time eg. 20140101, 1000 20140105,-400 In SSAS Tabular, I want to add a balance (saldo) measure, that shows the balance on any given date from my date dimension Balance 20140106: 600 I can do this by using SUM
-
App disappeared after I sync with iTunes
Hi,I recently bought three apps using my iPod touch and after I downloaded them I connected my ipod to sync them to my computer, a couple of days after I deleted two of them from my ipod to make some space to rent a movie. The following day I connect
-
Error 6 on PSE8 for Mac.. HELP!
Getting Error 6. May be due to the Adobe folder in my library folder but not in my application support... For the Mac