Gal Rubinstein

Greenhorn
+ Follow
since Jan 13, 2008
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 Gal Rubinstein

but when I close the OutputStream by calling stream.close(); I get a "socket is close" exception on 'socket.getInputStream();'

is there another way of closing the output stream without closing the socket?

Thanks,
Gal
Hi All,

I'm trying to create a scenario with clinet server talking to each other in stream, here is the code:



when the client is only writing and server just reading it's ok, but when I added the ability of server to write back
(output stream) it gets stuck on the marked line in Server.java

any ideas how to fix this?

Thanks,
Gal

Henry Wong wrote:

also I added the 'server' vm argument: java -server -jar xxx.jar



The "-server" option has nothing to do with networking. This option specifes that the JVM should use the "server" JIT compiler -- which is optimized better for longer running programs.

Henry



Thank you.
yeap, it works..

I just had to use the server's machine 'name' and not it's local ip to connect to the server.... probably the DNS person will be able to explain this.

also I added the 'server' vm argument: java -server -jar xxx.jar

Thanks a lot,
Gal

Marco Ehrentreich wrote:Hi Gal,

I don't really understand the problem. Where do you see that any remot port is "0"? Are you talking about the server side or the client side? If you're opening a socket we're only on the server side. What else does this application do?

Marco



I would try to explain :

the main problem is that I cannot to connect to this server, the one I mention, from any computer other then localhost. I'm sure its not firewall it's disabled and the router has been set.
so, when I say 'remote' a mean "open for anther computer on the network".. hope this helps.

when I do a System.out.println of the ServerSocket I see:


so 'port=0', I'm guessing that the is the port to machines outside localhost.

what do I do?

hope this makes it clearer.

Thanks
Hi All,

I'm trying to open an application using a ServerSocket inside a thread like so:



and I get that the remote port is 0.

even if I try opening the server socket with just the port number I get the same affect... like so:



what is the problem?

Thank you,
Gal
When you say native... it actually means writing C code, right?

or will they make a thing layer? like NIO?

because, as you state, these are different chipset.

Thanks
13 years ago
As a java/C++ programmer it is clearly noticed that, in many cases, having a virtual machine gives
code portability but gives bad performance because of the many layers.

is this thr case in Android?

Thank you
13 years ago
thank you very much... it's working perfectly..

by the way, in EJB3 you don't need to do narrow() anymore, specially on jboss ejb3 container...

again, thank you, you where a good aspirin for this head ache :-)

Gal.

ps: is there anyway to announce this post as resolved, other might be running into this problem.
Sorry about that, here is the rest of the code.
first the mysql-ds.xml


and here is the persistence.xml


the entity and table I have already added, here is the manager bean:


bare in mind that in the entity the toString() has been over written and there is a @PostPersist the prints out the id.

the executable is quit standard: creates a new Entity, sets the 'name' property, looks up the manager and use its create(test) method. after that prints out the entity. this is how you can see the null in the toString() in comparison to the @PostPersist.

thank you for the effort. hope this helps,

gal
sry... that doesn't help also, the more I search around the more I see other people with that problem.


at the workplace we moved to work with MS-SQL because of this.

tried fire-bird, also problematic with JPA, specially with jboss.

if there is no solution, are there other open source RDBMS-es that I can use?

(PS, maybe it lingual problems, but I could understand if oracleXE is free or not)

thank you for the help
Tried that, doesn't work, don't really understand why the Entity doesn't have the id, it seems like ether the id gets nulled or the @PostPersist shows the entity state after the toString() is activated.. also tried with or without manager.flush() without any results.. so weird, don't have that problem with neither with Oracle or MSSql..

Hope you have any clue...

Gal
It's simple: there is an Entity
{
@Id private Integer
private String name
}
..getters and setters.

table, persistence.xml and mysql-ds.xml file all working well:

entityManager.persist(test); adds a line to DB,
getById also works (using EJB-QL...).

the problem:
after I do persist for that bean I get null from the getID() method of the
entity.

further test:
I add a @PostPersist method that prints the id value, and guess what? it printed the Id that was given (auto increment) in the table.

so:
the insertion went fine. but why is there null when invoking getId()
after persist?

thank all in advance.
Gal

p.s.: here is the table and the bean:

[ January 13, 2008: Message edited by: Gal Rubinstein ]