George Berish

Greenhorn
+ Follow
since Oct 28, 2004
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 George Berish

Hi,

Can anyone tell me how to get the HornetQ API to my ear application on Wildfly?

My Message Driven Bean onMessage(Message msg) receives a message.

Then msg.getClass().getSimpleName() returns "HornetQObjectMessage".

But when I try to cast msg to HornetQObjectMessage the WildFly Log says:

I can see org/hornetq/jms/client/HornetQObjectMessage.class in this jar: WildFlyHome\modules\system\layers\base\org\hornetq\main\hornetq-core-client-2.4.7.Final.jar

So I know its there.

I tried adding this module I got from Oracle

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.acmemq">
<dependencies>
<!-- we depend on org.hornetq module since we will send messages to -->
<!-- the HornetQ server embedded in the local WildFly instance -->
<module name="org.hornetq" />
</dependencies>
</module>

Then I modified the module's name to be my package name - GoTest.ear

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="GoTest.ear"
><dependencies>
<module name="org.hornetq" />
</dependencies>
</module>

Nothing works. Everything I can find says I need to force the class loader to load dependencies. But I just can't seem to get my app dependent on the HornetQ API.

Can anyone offer any help on how to do that in this case?
3 years ago
This code fails when used by a local java client to lookup a JMS ConnectionFactory from a Glassfish server running on localhost.

Can anyone tell me why? I'm so desperate even useful insults are welcome. I put the Console output below (as formatted by my program).


Console Output

Thanks.

Here is a complete truncated Class whose only purpose is to secure a ConnectionFactory.

Here is the console ouput.

I tried to attach a screen shot of my glassfish console that shows there really is a ConnectionFactory configured under Resources/JMS Resources/Connection Factories with a jndi name of "jms/goConnectionFactory". But the web page doesn't seem to show it on preview. If it doesn't show up I'll try again all by itself.

Note: The attachment to the first post mistakenly showed the jms.Queue resources, but my local client never has to look them up. So I'm sure if I can get a ConnectionFactory the rest will fall back into place.

I truly appreciate any help or suggestions. This seems to be about as simple a step, using the simplest test code, with the most generic set up, I can imagine. And it's been defeating me all week.
3 years ago
I hope you mean it when you said greenhorns welcome, because after three days of searching I can't make this simple, seemingly generic example work.

My glassfish4 server runs on "localhost".

My java GUI client is run by Eclipse.

My glassfish4 Admin Console clearly shows under Resources/JMS Resouces/Connection Factories that I have a ConnectionFactory properly configured with a JNDI name = "jms/goConnectionFactory"

So by all that's holy, and many many postings, this code should result with my Java client in possession of that Connection Factory. But it refuses.

Can anyone please help?

Here is the code.

println(jndiContext.toString()) statement in the code prints this to the console
javax.naming.InitialContext
So I have some kind of context, I just don't know how to test it to see if it is really from glassfish or some Default context.

A try catch block around lookup() catches a NullPointerException.

I have glassfish-naming.jar in my path. It clearly contains com.sun.enterprise.naming.impl.SerialInitContextFactory.
Ditto imq-4.2.jar that has a lot of com.sun.messaging and com.sun.jms classes.

I can't see anything in the server log that indicates glassfish even notices when my client runs the above code.

I mean its such a trivial bit of code ... and such a common test environment (i.e. local Eclipse java client trying to get a connection to a local glassfish server) there must be hundreds of examples. But I can't find one. (Oracal is so focused on interactions between EJB containers it seems blind to anyone using a plain old java client.)

Ditto most other postings ... Session beans to other Session beans ... on same servers or separate ones. And they all use injection instead of properties.

Thanks for any help of suggestions.







3 years ago
Hi Tim,

I appreciate your staying with this. Thank you.
At a minimum I know I'm not going crazy.

Anyway ... sorry, but No. You can't use a 1 letter id and pw unless, and until, you first edit the add-user.properties file that arrives all set up to require 8 characters w/ 1-digit, 1-alpha and 1-special. So I can't stay out of there.

But ... I couldn't agree more with
"Actually editing those files directly is something best done by people who understand how it all fits together."

I mean that is what I did the first time. Stayed out. Used add-user.bat to create the id and pw demanded by Wildfly. And ... ta dum ... when done I was told by Wildfly that I could not see the ADMINISTRATOR tab unless I executed the code I showed earlier in the CLI.

Catch was that when I executed the code
... Wildfly told me I now lack the credentials to even see the Console anymore ... at all ... ever.

It just did it again when I ripped it all out and reinstalled

So I really think it fair to say
-- Wildfly is a club intended for people whose primary job is deployment that is next to useless for folks whose primary interest is in developing with Java code, and
-- Glassfish is the reverse.

So unless you have a better suggestion, I don't see as I have any option but to scrap the idea of using Wildfly for a few years. And go back to Glassfish.

Thank you again. I hope this info at least helps anyone else considering Wildfly.

glb
4 years ago
Hi Tim,

Thank you for your time and help. I'll go slog through a minimal course on server security ... even though I have no need for it.

I just needed Wildfly to tryout some stuff that someone else will someday have to deploy ... although for now the stuff lives in an environment where no one else has access.

But to clarify:
I reinstalled a brand new out of the box Wildfly just to clear out any junk I may have added to its over zealous security code.
I remembered to edit add-user.properties so I could use a short pw/id
I went to the console and obediently obeyed its demand I password protect access. (so far so good)
I poked around in the console (9990) to see what the Administration Tab did.
Wildfly told me I had to run the following code to use that Tab.

So I used the CLI to do as told. (so far so good)
It gave me access to the Tab.

Then went away.
Then came back.
Now I'm locked out of the console entirely. (so far ... not good.)

So if you wouldn't mind, I'd much appreciate your just confirming whether I can reclaim control by modifying stuff in standalone-full.xml
... or if I need to reinstall again.
Right now, http://localhost:9990/console/App.html gets me nothing but rejected

For what it's worth. The biggest problem I've had with the forums everywhere is how often people on the inside offer advice (I assume is great) on what to change
... without giving even a hint of where the heck it get's changed.

Take for example you note:
... "You can look at the existing database and SIMPLY repeat what the original admin ...."
Yep. No doubt I could.
Grin ... Just let me google "existing database" to see what you meant.

Thanks again,
I do appreciate your time,
and ... this too shall pass,
glb








4 years ago
Hi Tim,

Thank you for the suggestions.

[Although I'm still at a loss for a worst documented major software. Grin ... but that's just me.]

So ... I was all reconciled to just going with you suggestion -- a one letter id and password
... but Wildfly decided to bite me in the pants instead.

I decided to install it again from scratch.
I changed the config files to permit a one letter id and pw (something you didn't mention was required).
I was happy.
I closed Foxfire.
I opened it again
went to http://localhost:9990/console/App.html
Tried to log in.
Was greeted (or repelled with)

"ACCESS DENIED Insufficient privileges to access this interface."

Not really enjoying Wildfly yet, so if you have any suggestions I'd appreciate them.

It really does feel like Wildfly is more a cult intent on minimizing its inner circle than a software its developers hope will see wide use.


glb
4 years ago
Hi,

With apologies, I have to say that Wildly is the least intuitive, most poorly documented piece of software I can remember encountering. Those developing it seems more like a closed cult than a group intent on seeing it widely used.

With that said, I'd like to know how to remove the need for a password from the console for my local development Wildfly. There is no need for it, because there is no access to it by anyone other than me on my private PC. And Logging in every time is getting to be a real pain.

Thanks for any help.
glb
4 years ago
Hi Pual,
Ummm ... not settled but understood.
Thanks for your help.
Stay warm.
Just because I live in Hawaii doesn't mean I don't have empathy for who can't live any further than ... dunno ... Detroit MN?
glb
7 years ago
Hi Paul,

Yep. I thought about "Unknown" as the addressee.

But messages that arrive with something like "Unknown" in the TO: line are often blocked or deleted without opening ... which is what I do.

Plus ... the BCC: reader needs to know who the TO: addressee is to make sense of the message and understand why they are getting a BCC:.

For example, a letter to the editor to a paper (TO:) that I wish to send to friends at the same time.

I mean a Canadian liberal has monopoly ownership of our only paper, so the chance of anything that interests me getting published is zero.

Therefore when I invest in the time to write a letter, I just use the paper to fill the TO: line so I can protect my friends -- only reader -- on the BCC: lline.

Its just that TO: editor@staradvertiser.com is more likely to get opened than "Unknown".

But alas ... life is not always cooperative ... so for now I'll have to live with the fact there is no way to automate addressing when domains like Yahoo.com are included.


FYI: Now I send the email with all domains that don't produce 452 errors.
Then I take the sent copy and manually forward it to myself with a little note explaining why they weren't included in the original message BCC: line.


But thanks for your help. It saved me lots of time.

glb



7 years ago
Hi Paul,

Thanks for the info.

But I'm pretty sure that
"452 Too many reciients"
is a SPAM related response that means the message will not be delivered.

Its not just a warning that the system is temporarily overloaded and will deliver it later.

I mean I've triggered Yahoo's defensive response with as few as 20 @Yahoo.com addressees, and its hard to belive that would pull any "overload" trigger.

I'm still not sure how Yahoo adminsters that filter, but somehow Yahoo senses when the same message arriving for too many of its accounts in too short a time it rejects it in total for all of the accounts.

But given what you told me it sounds like

-- My local JavaMail API app assembles a single "entity" with all the info, data addressees and sends it to the email server running on the virtual server (hosted by eApps) that serves my domain.

-- Then I'm guessing my server only splits it into separate "entities" for each distinct domain. I mean if my message has 5 addresses at Yahoo.com and 12 at hotmail.com and 2 at hawaii.rr.com my server only sends out 3 "entities".

-- Then when Yahoo.com, hotmail.com, and hawaii.rr.com receive those it is their servers that create and deliver the 5, 12, and 2 individual messages.

?

Regardless ... It looks like there is no way to get the BCC: copies sent at spaced out intervals.

I mean if the message doesn't get broken up into separate copies for each individual addressee until it gets to the domain of each recipient group, I can't even break them up into small groups, because that would flood the TO: addressee with multiple copies.

glb
7 years ago
I'm experimenting with sending a large email mailing using Java's email API to permit me to attach files and insert images.

The problem I'm addressing is ERROR 452. I.e. Domains like Yahoo that will not permit too many emails from a single sender to be delivered to Yahoo email accounts in too short a time period.

For example, sending to a list with say 25 "@yahoo.com" addresses will trigger its SPAM blocker. It will not deliver the message. Instead it will return ERROR 452 message to the sender.

When I want to use the list for TO: addresses it's easy to overcome that problem, because I can code a delay between each send that is sufficiently long to avoid triggering ERROR 452 by the domain that has such a blocker.

When I send an email to a single TO: address and put my long list as BCC: addresses I can't figure out if, or how, I can spread out transmission of the BCC: copies.

So I need to learn more about how Java API works.

More specifically ... assume I create a message with a
-- single TO: address and
-- 50 BCC: addressees.

1. Does the App send a single message to the ISP server that relies on the ISP server create a separate message for each TO:, CC:, and BCC: addressee? (Bad ... because then I can't delay transmission of BCC: messages to dodge the 452.)

or

2. Does the Java API create the separate messages required for each addressee and send them to the ISP for delivery? (Good ... In which case it seems I have a hope of transmitting the copy for each BCC: addressee at delayed intervals)

or

Does anyone have any other suggestions for how to deal with long BCC: address lists?

Thanks,
glb
7 years ago
Hi Paul,

Thank you.
Grin ... Even though your explanation made me feel dumb, it solved my problem
... or more correctly: it let me solve the problem with my coding problem.
Why I didn't know that I already knew that ... I guess I'll never figure out.
[Note to self: Duh!
... of coure Applets run on the browser not the server
... that's why God gave us Applets in the first place!]

In the morning I'm headed to the court to change my name.

xyz

PS: Its kind or incredible, but even though a few hours of web searching found serveal discussions of "logging" from an Applet ... one of them pointed out the obvious ... as you did. thanks again.
7 years ago
Hi,

I auto deploy an Applet as part of an EAR package on a Glassfishv3 server.

On the Glassfish on my local computer (localhost:) the Applet works works perfectly.

But when I deploy the same package on the same version of Glassfish running on a virtual server I rent from a host. It fails miserably.

Not only does the Applet not show up on its web page, but when I click on the empty area that says "Click Here For Details" ... it locks up the browser.

Snf the messages in gassfish's server logs are useless, so I'd like to add some Log4J tracking.

I have a singleton Servlet deployed with the package that has no problem initializing a Logger.

Then it has has no problem creating my.log and wrting to it.

But I just can't find a way to get the Applet to use that Logger .... or write anything anywhere I can find.

I assume the explanation is the Servlet runs inside the Glassfish's context, so it's allowed to log to <Glassfish_Home>/domains/domain1/logs/server.log or my.log

But the Applet is trapped inside an application sandbox it can't get out of. Or reach outside or to find the initialize Logger

And no.
System.out.printlin() from the Applet doesn't go anywhere either.
But again, form the Servlet, System.out.println () goes to server.log.

I'm thinking it must be possible to initialize Logger programmatically in the Applet's init() method so that it writes to a log file it creates inside the application

... but that seems inelgant because it would reinitialize Logger every time an Applet was launched.

... And I have no idea what grief that would cause under heavy use.

And I just don't know how to get anything except a Servlet to automatically run – Once -- when the package is first loaded.

Obviously I'm floundering (no pun) in glassfish.

Anyone able to point me to a good direction?

I mean I have no idea how to debug my Remote-Only Applet bug if I can't get the Applet to write stuff to me somewhere.

Thanks

George
7 years ago
Hi,
No I Didn't have: com.sun.appserv.naming.S1ASCtxFactory
Now I do. For reference it lives in:{GlassfishServer Home}\lib\appserv-rt.jar

Now my program's printline outputs:
ERROR: RuntimeException
Cannot Proceed. No Endpoints specified.

And the System.err print stream outputs:
Sep 2, 2009 9:34:19 AM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
WARNING: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpoints.
Sep 2, 2009 9:34:19 AM com.sun.appserv.naming.RoundRobinPolicy getEndpointForProviderURL
WARNING: NAM1002 : Exception : (0) thrown for bad provider URL String: http://localhost:8080
Sep 2, 2009 9:34:19 AM com.sun.appserv.naming.S1ASCtxFactory getInitialContext
SEVERE: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpoints.


I looked up the first warning and found a suggestion that I needed to chage my URL property to:
FM: java.naming.provider.url=http://localhost:8080
TO: java.naming.provider.url=iiop://localhost:3700 [Also tried 8080 and 4848 with same result-failure]

That changed the System.err print stream output to:
Sep 2, 2009 9:46:22 AM com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo
WARNING: NAM1005 : No Endpoints selected. Please specify using system property com.sun.appserv.iiop.endpoints.
Sep 2, 2009 9:46:22 AM com.sun.appserv.naming.RoundRobinPolicy getEndpointForProviderURL
WARNING: NAM1001: No Endpoints selected in com.sun.appserv.iiop.endpoints property. Using JNDI Provider URL iiop://localhost:3700 instead
Exception in thread "main" java.lang.NoClassDefFoundError: javax/security/jacc/PolicyContextException
at com.sun.enterprise.security.SSLUtils.<clinit>(SSLUtils.java:102)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.<init>(IIOPSSLSocketFactory.java:182)


Now all I have it the "No Endpoints" warning. Anyone know what that is.

And the instruction to Using JNDI Provider URL iiop://localhost:3700 instead is confusing, because that is what I tried.

Help.
GLB